C#目标=" _blank"在一个LinkButton
问题描述:
是有可能有一个目标=_空白
在的LinkButton
...矿似乎没有被工作
is it possible to have a target="_blank"
in LinkButton
...mine doesnt seem to be working
<asp:LinkButton runat="server" ID="g31" Text="PDF" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"productID") %>' CommandName='<%# DataBinder.Eval(Container.DataItem,"documentID") %>' OnCommand="linkbutton_showpdf" target="_blank"></asp:LinkButton>
或者将我必须使用不同的按钮格式?
Or would I have to use a different button format?
答
刚刚渲染的href设置为相应的URL锚,并设置目标
属性 。_blank
它会打开网址进入新窗口
Just render an anchor with href set to appropriate url and set the target
attribute to _blank
it will open the url into new window.
<a href="urlOfThePage" target="_blank" >Click me</a>