如何在GridView控件LinkButton控件打开一个新的IE窗口 [英] How to make linkbutton control in gridview open an new ie window
问题描述
我需要
<asp:TemplateField HeaderText ="ename">
<ItemTemplate > <asp:Label ID="lbl2" Text ='<%#Eval("ID") %>' runat ="server" >
</asp:Label>
</ItemTemplate>
<EditItemTemplate >
<asp:TextBox ID ="textbox1" Text='<%#Eval("name")%>' runat ="server" ></asp:TextBox>
<asp:LinkButton ID ="link1" Text='<%#Eval("name")%>' runat ="server" ></asp:LinkButton>
</EditItemTemplate>
</asp:TemplateField>
我在修改的ItemTemplate 的文本和链接按钮
根据条件()
i have an textbox and link button in Edit itemtemplate based on the condition()
如果(文='&LT;%#的eval(ID)%>')
if(Text ='<%#Eval("ID") %>')
ID = 1显示文本
id=1 show textbox[edit item temalpate]
ID = 2显示链接按钮
id=2 show link button[edit item temalpate]
ID = 3显示链接按钮
id=3 show link button[edit item temalpate]
现在链接按钮,我有值 [文字='&LT;%#的eval(name)的%GT;']
(例如:www.stackoverflow.com ,google.com)
因此一个在用户点击链接按钮打开一个新的浏览器窗口,并显示该网站显示在链接按钮的clcik
now in link button i have value [Text='<%#Eval("name")%>']
(eg:www.stackoverflow.com ,google.com)
so that one an user clicks on the link button open a new browser window and show that website show to open an new browser window on the clcik of the link button
推荐答案
您可以使用的超链接控制,而不是一个LinkButton?
Could you use a HyperLink control rather than a LinkButton?
例如
<asp:HyperLink id="hyperlink1"
NavigateUrl="<%#Eval('name')%>"
Text="<%#Eval('name')%>"
Target="_blank"
runat="server"/>
这篇关于如何在GridView控件LinkButton控件打开一个新的IE窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!