asp.net - Adding Literals inside an ASP Hyperlink Control -
i creating asp.net hyperlink controls programatically code behind so:
dim thebritishflag new hyperlink() thebritishflag.imageurl = configurationmanager.appsettings("blobstorageurlhttp") & "assets/images/winasafari/enflag.png" thebritishflag.navigateurl = sectionfunctions.getsectionlink(request.querystring("sectionid"), "en", "gb") notice setting imageurl property of hyperlink means on page, hyperlink rendered so:
<a href="../../../../fr/fr/s/3499/meet-a-cheetah-home.aspx"> <img src="../assets/images/winasafari/frflag.png" alt="" /> <!-- literal should go--></a> i add new asp literal 1 below inside of hyperlink code above:
dim thebritishflagtext new literal() thebritishflagtext.text = "english" thebritishflag.controls.add(thebritishflagtext) does asp hyperlink allow child controls (such literals) added (inside of rendered <a> tags? because finding not working (no text appears inside of rendered <a> tags)
i have tagged vb.net , c# because web app uses both.
(and yes i've added controls featured above page.)
you should able it
thebritishflag .controls.add(thebritishflagtext) update
i have tested , works. have added hyperlink page's control ??
hyperlink abc = new hyperlink(); abc.navigateurl = "www.someurl.com"; literal xy = new literal(); xy.text = "click here"; abc.controls.add(xy); //add literal hyperlink control image = new image(); i.imageurl = "http://www.google.co.in/intl/en_all/images/logos/images_logo_lg.gif"; abc.controls.add(i); //add image this.controls.add(abc); //add hyperlink page control
Comments
Post a Comment