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

发布于 2024-09-06 15:36:24 字数 114 浏览 2 评论 0原文

我的 vb.net 代码中有这个。 label1.text =“单击此一个继续”

现在,对于标签文本中的此一个,我想给它一个超链接或response.redirect。我有什么想法可以做到这一点吗?

i have this in my vb.net code.
label1.text = "Click on THIS ONE to proceed"

Now for the THIS ONE in the label text i want to give it a hyperlink or response.redirect. Any ideas how i can do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

赠意 2024-09-13 15:36:24

我的建议是按照以下方式进行。

将 Label 控件替换为 Literal,然后这样做

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

My recommendation here would be to do it the following way.

Replace the Label control with a Literal then do it this way

literal1.Text = "Click on <a href='yoururl'>THIS ONE</a> to proceed"
强者自强 2024-09-13 15:36:24

您不能在单个标签内执行此操作。

相反,您可以使用 Literal 控件 并设置Text 以包含 标记。

或者,您可以使用服务器端超链接控件。

You cannot do this inside a single label.

Instead, you can use a Literal control and set the Text to include an <a> tag.

Alternatively, you can use a server-side hyperlink control.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文