简体   繁体   English

在vb.net中的标签内放置超链接

[英]putting a hyperlink inside of a label in vb.net

i have this in my vb.net code. 我的vb.net代码中有这个。 label1.text = "Click on THIS ONE to proceed" label1.text =“单击“继续”

Now for the THIS ONE in the label text i want to give it a hyperlink or response.redirect. 现在,对于标签文本中的“这个”,我想给它一个超链接或response.redirect。 Any ideas how i can do this? 任何想法我该怎么做?

My recommendation here would be to do it the following way. 我的建议是按照以下方式进行操作。

Replace the Label control with a Literal then do it this way 用文字替换Label控件,然后用这种方式

literal1.Text = "Click on <a href='yoururl'>THIS ONE</a> to proceed"

You cannot do this inside a single label. 您不能在单个标签内执行此操作。

Instead, you can use a Literal control and set the Text to include an <a> tag. 相反,您可以使用Literal控件并将Text设置为包含<a>标记。

Alternatively, you can use a server-side hyperlink control. 或者,您可以使用服务器端超链接控件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM