asp.net js 方法传参
asp.net 前台页面有Js 方法用于模态对话框页面的打开.
function OpenEdit(frmWin,width,height)
{
var me;
me = window;
var returnVal = window.showModalDialog(frmWin,me,'dialogWidth='+width +'px;dialogHeight='+height+'px;help:no;status:no;')
}
GridView 中有列点击时打开模态对话框. SN,BU 通过绑定取值.传入js方法采用this.
<asp:TemplateField HeaderText="Edit">
<ItemTemplate>
<asp:ImageButton ID = "ibnEdit" runat="server" ImageUrl ="~/Images/edit.GIF" sn='<%# Eval("SN")%>' bu ='<%# Eval("BU")%>' OnClientClick ="OpenEdit('BP_ModelSpec_Edit.aspx?SN=' + this.sn +'&BU=' + this.bu ,800,400);return false"/>
</ItemTemplate>
</asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID = "ibnEdit" runat="server" ImageUrl ="~/Images/edit.GIF" sn='<%# Eval("SN")%>' bu ='<%# Eval("BU")%>' OnClientClick ="OpenEdit('BP_ModelSpec_Edit.aspx?SN=' + this.sn +'&BU=' + this.bu ,800,400);return false"/>
</ItemTemplate>
</asp:TemplateField>