I am creating ASP.NET Hyperlink controls programatically from the code behind like so:
Dim theBritishFlag As New HyperLink()
theBritishFlag.ImageUrl = ConfigurationManager.AppSettings("blobStorageURLHTTP") & "assets/images/winASafari/enFlag.png"
theBritishFlag.NavigateUrl = sectionFunctions.getSectionLink(Request.QueryString("sectionID"), "en", "gb")
Notice that I setting the ImageUrl property of the Hyperlink which means on the page, the hyperlink is rendered like so:
<a href="../../../../fr/fr/s/3499/meet-a-cheetah-home.aspx">
<img src="../assets/images/winASafari/frFlag.png" alt="" />
<!-- this is where the Literal should go--></a>
I would like to add a new ASP Literal like the one below inside of my Hyperlink code above:
Dim theBritishFlagText As New Literal()
theBritishFlagText.Text = "English"
theBritishFlag.Controls.Add(theBritishFlagText)
Does the ASP Hyperlink allow for child controls (such as Literals) to be added to it (inside of its rendered <a>
tags? Because I am finding that this is not working (no text appears inside of the rendered <a>
tags)
I have tagged with VB.NET and C# because this web app uses both.
(And yes I've properly added all controls featured above to the page.)