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
ASP.NETC#.NET Programming

Avatar of undefined
Last Comment
viralpala

8/22/2022 - Mon
Dale Burrell

label.text = "You have new orders, that can be viewed at : <a href=\"www.blahblah.com\">SiteName</a>";
MikeMCSD

label.Text = "can be viewed at : <a href=" + "http://rt.com/" + " >rt.com</a>";
ASKER CERTIFIED SOLUTION
MikeMCSD

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Kamal Khaleefa

label.text = "You have new orders, that can be viewed at : <a href='"  + some hyperlink +"'  />"
Your help has saved me hundreds of hours of internet surfing.
fblack61
Anuradha Goli

label.text = "You have new orders, that can be viewed at : < a href='"  + some hyperlink +"'/>"
viralpala

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>";
viralpala

at least give some points to other because  other also provide you the detailed answer.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.