MailMerge: Merging Hyperlinks using the FieldMerged Event
Summary
The Mail ╰ TX Text Control .NET Server for ASP.NET ╰ DocumentServer Namespace ╰ MailMerge Class The MailMerge class is a .NET component that can be used to effortlessly merge template documents with database content in .NET projects, such as ASP.NET web applications, web services or Windows services. In the following screenshot, a simple template is created using TX Text Control that consists of 2 merge fields: The following class is used to create the data source object for this sample merge process: Pay attention to the Hyperlink class that contains the actual display Text and the Target. In the event handler, we check whether the returned DataRow object is a custom Hyperlink object: In case, the object is a Hyperlink, a temporary Server ╰ TX Text Control .NET Server for ASP.NET ╰ TXTextControl Namespace ╰ ServerTextControl Class The ServerTextControl class implements a component that provide high-level text processing features for server-based applications. is used to generate a new hyperlink with the same format (font, color, ...) that is eventually returned to the Merged ╰ TX Text Control .NET Server for ASP.NET ╰ DocumentServer Namespace ╰ MailMerge.FieldMergedEventArgs Class ╰ MergedField Property Gets or sets a byte array that contains the complete data of the merged field. In the resulting document, the website merge field is converted into a clickable hypertext link: