日期:2014-05-18 浏览次数:20449 次
<asp:TemplateField HeaderText="ButtonOnClientOpen"> <itemstyle horizontalalign="Center" /> <ItemTemplate> <asp:Button ID="btnWinOpen" runat="server" OnClientClick="window.open('Detail.aspx?id=100','','toolbar=no');" Text="OnClientClick" /> </ItemTemplate> </asp:TemplateField>
<asp:TemplateField HeaderText="ButtonOnClientOpen"> <itemstyle horizontalalign="Center" /> <ItemTemplate> <asp:Button ID="btnWinOpen" runat="server" OnClientClick="window.open('Detail.aspx?id=Eval("ID")','','toolbar=no');" Text="OnClientClick" /> </ItemTemplate> </asp:TemplateField>
<a href="javascript:void(0)" onclick="window.open('<%# "ImgUpload.aspx?id=" + Eval("User_Id") %>', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=400,height=300,left='+(screen.width-400)/2+',top='+(screen.height-300)/2)" >修改</a>
------解决方案--------------------
<asp:TemplateField HeaderText="ButtonOnClientOpen"> <itemstyle horizontalalign="Center" /> <ItemTemplate> <asp:Button ID="btnWinOpen" runat="server" OnClientClick='<%# Eval("ID","window.open('Detail.aspx?id={0}','','toolbar=no');") %>' Text="OnClientClick" /> </ItemTemplate> </asp:TemplateField>