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
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>";
Avatar of MikeMCSD
MikeMCSD
Flag of United States of America image

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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
label.text = "You have new orders, that can be viewed at : <a href='"  + some hyperlink +"'  />"
Avatar of Anuradha Goli
Anuradha Goli
Flag of Ireland image

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

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>";
Avatar of viralpala
viralpala
Flag of India image

at least give some points to other because  other also provide you the detailed answer.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo