.NET ------ 两种传参方式
两种提示方式
第一种后台传递
<table cellpadding="0" cellspacing="4" class="ttable_border_none"> <tr><td>选择标题:</td><td><uc2:WebCtrl_JieSuanTitle ID="WebCtrl_JieSuanTitle2" runat="server" /></td> <td> <asp:Button ID="btnExcel" runat="server" Text="Excel导入" CssClass="ttbtn" OnClick="btnExcel_Click" /> <asp:Button ID="btnDelete" runat="server" CssClass="ttbtn" onclick="btnDelete_Click" OnClientClick="return confirm('您确认执行删除操作吗?') && GetCheckGuid()" Text="删除" /> <asp:Label ID="LabelEditMsg" runat="server" ForeColor="#FF3300" Text=""></asp:Label> </td></tr> </table>
后端传递
protected void btnExcel_Click(object sender, EventArgs e) { if (this.WebCtrl_JieSuanTitle2._HidJieSuanGuid == string.Empty) { WebMessageBox1.MessageBox_tishi(Master, 300, 200, "请选择标题后再导入Excel"); return; } string js = "WebDialogLoad('Excel导入', 800, 600, '../qdExcel/JiXiao_Excel_Upload_win.aspx?pwidth=780&pheight=480&btn="+ btnSearch.ClientID + "&titleguid="+ this.WebCtrl_JieSuanTitle2._HidJieSuanGuid + "')"; ScriptManager.RegisterStartupScript(UpdatePanelRepeater, this.Page.GetType(), "", js, true); //后台调用示范,可删除 //有UpdatePanel用如下代码调用js //ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "js();", true); //没有UpdatePanel用如下代码调用 //this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'>js();</script>", false); //有UpdatePanel弹窗调用如下 }
第二种前台直接传递
<td align="center"> <a href="javascript:return false;" title="导入" onclick="javascript: WebDialogLoad('Excel导入', 800, 600, '../qdExcel/GongZi_Excel_Upload_win.aspx?pwidth=780&pheight=480&edit=add&rtn=<%=btnSearch.ClientID %>&titleguid=<%=WebCtrl_JieSuanTitle1._HidJieSuanGuid %>')" ><img src="../qdimages/excel2.png" border="0" title="Excel导入"></a> <asp:LinkButton ID="LinkButtonSave" runat="server" OnClick="Rpbtn_SaveAll_Click"><img src="../qdimages/Save.png" border="0" title="批量保存"></asp:LinkButton> </td>