AddAttributesToRender

  •  05-19-2005, 6:00 AM

    AddAttributesToRender

    I'm working on an apllication, that is supposed to offer the user the possibility to choose a set of links from a dropdownlist in ce. The user should be able to select any text in the editor and then make that text one of the links provided by the dropdownbox. So far no problem using a link dropdownbox. But how do i set additional attributes of the anchor inserted by ce. For example i want to insert a target and a id attribute. The link has to appear in the correct format without any other user interaction except the dropdownlist. I tried the following, but the additional attribute won't render after using the dropdownbox:
     
                    ddlLinks.Items.Add("Debug", "http://www.google.de") 'This is item index 1
                    Dim wrtText As New System.IO.StringWriter
                    Dim wrtAttributes As New HtmlTextWriter(wrtText)
                    wrtAttributes.WriteAttribute("id", "debug")
                    ddlLinks.Items(1).AddAttributesToRender(wrtAttributes)

    Can anyone help me. This would be very nice. Thanks.
     
View Complete Thread