如图:
1、前台链接,直接传参
<input id="btnExcelDown" type="button" value="Excel导入" class="ttbtn" onclick="javascript: WebDialogLoad('Excel导入', 800, 600, '../qdExcel/UserInfo_Excel_Upload_win.aspx?pwidth=780&pheight=480&edit=add&rtn=<%=btnSearch.ClientID %>')" title="导入时替换原有数据" />
2、后台链接,通过按钮触发方法,转到新的界面
前面按钮
<asp:Button ID="btnExcel" runat="server" Text="Excel导入" CssClass="ttbtn" OnClick="btnExcel_Click" />
后面通过方法判断传参
protected void btnExcel_Click(object sender, EventArgs e) { if (this.WebCtrl_JieSuanTitle2._HidJieSuanGuid == string.Empty) { WebMessageBox1.MessageBox_tishi(Master, 300, 200, "请选择标题后再导入Excel"); return; } //后台调用示范,可删除 //有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弹窗调用如下 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); }