...
...
HtmlTextWriter write12 = new HtmlTextWriter(stringWriter);
...
...
write12.AddAttribute("href", myURL);
write12.WriteEncodedText("Click here to redirect");
...
...
答案 0 :(得分:0)
我是否理解您想要在新窗口中打开链接?
您可以将目标设置为_blank
像这样,根本没有经过测试:
HtmlTextWriter write12 = new HtmlTextWriter(stringWriter);
write12.AddAttribute("href", myURL);
write12.AddAttribute("target", "_blank");
write12.WriteEncodedText("Click here to redirect");
答案 1 :(得分:0)
只需添加onclick
属性:
write12.AddAttribute("onclick", "JsFunction()");
的Javascript
function JsFunction()
{
// open popup
// ...
}