<asp:LinkButton ID="lnbSeach" CssClass="BtnSearch" runat="server" Text="Seach" OnClientClick='window.open("ItemSeach.aspx?ItemID=123", "_blank")' />
如何替换123
更改为'<%# Eval("FileCode")) %>'
答案 0 :(得分:0)
使用以下代码:
<asp:LinkButton ID="lnbSeach" CssClass="BtnSearch" runat="server" Text="Seach" OnClientClick='window.open("ItemSeach.aspx?ItemID="+ Eval("FileCode") + "", "_blank")' />
或
<asp:LinkButton ID="lnbSeach" CssClass="BtnSearch" runat="server" Text="Seach" OnClientClick='<%# Eval("FileCode","window.open('ItemSeach.aspx?ItemID={0}', '_blank') %>' />