Link to home
Start Free TrialLog in
Avatar of countrymeister
countrymeister

asked on

how to format a hyperlink in a string in ASP.NET

I have an ASP.NET page which has a label field.
I need to format the label such that I have a message text and the hyperlink

Example
label.text = "You have new orders, that can be viewed at :"  + some hyperlink +

If I concat the url it does not show as a hyperlink, I need to dynamically creat a hyperlink
Avatar of Dale Burrell
Dale Burrell
Flag of New Zealand image

label.text = "You have new orders, that can be viewed at : <a href=\"www.blahblah.com\">SiteName</a>";
label.Text = "can be viewed at : <a href=" + "http://rt.com/" + " >rt.com</a>";
ASKER CERTIFIED SOLUTION
Avatar of MikeMCSD
MikeMCSD
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
label.text = "You have new orders, that can be viewed at : <a href='"  + some hyperlink +"'  />"
label.text = "You have new orders, that can be viewed at : < a href='"  + some hyperlink +"'/>"
To open in Same Page

lbl.Text = "can be viewed at : <a href=" + "http://www.yahoo.com" + " >" + "My Solution" + "</a>";

To Open in new Pop up window use below

lbl.Text = "can be viewed at : <a href=" + "http://www.yahoo.com" + " target=#>" + "My Solution" + "</a>";
at least give some points to other because  other also provide you the detailed answer.