HtmlTextWriter创建<a> tag</a>

时间:2014-07-29 23:23:52

标签: vb.net htmltextwriter

如何添加目标使用的HtmlTextWriter。我需要target ='_ blank'。有人会帮助我。

有代码:

Dim sw As StringWriter = New StringWriter()
Using ht As HtmlTextWriter = New HtmlTextWriter(sw)
                    ht.RenderBeginTag(HtmlTextWriterTag.A)
                    ht.AddAttribute(HtmlTextWriterAttribute.Href, "Order" & "/" & "FileName")
                    ht.Write("Order1")
                    ht.RenderEndTag()
 End Using

1 个答案:

答案 0 :(得分:0)

我需要这段代码,ht.AddAttribute(HtmlTextWriterAttribute.Target,“_ blank”)