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

countrymeister
countrymeister used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dale BurrellDirector

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

Commented:
label.Text = "can be viewed at : <a href=" + "http://rt.com/" + " >rt.com</a>";
Commented:
If your "some_hyperlink" is string, you can do this :


label.Text = "can be viewed at : <a href=" + some_hyperlink + " >" + some_hyperlink + "</a>";
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

Kamal KhaleefaInformation Security Specialist

Commented:
label.text = "You have new orders, that can be viewed at : <a href='"  + some hyperlink +"'  />"
Anuradha GoliSystems Development / Support Specialist

Commented:
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.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial