C#后台弹出式窗口,如何不让他自动刷新页面呢? 用js前台弹出,搜索js 弹窗 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 找一个jquery的组件,在后台封装一下。然后照样在cs代码中调用,前台也不会刷新。http://www.open-lib.com/Type/175-1.jsp 如果就是需要在后台弹出,用下面这种方式吧:ScriptManager.RegisterStartupScript(this, this.GetType(), "EditSuccess", "alert('" + message + "');", true);第三个参数是key,不填也行第四个参数是你的javascript第五个参数是addScriptTags,我一般默认是true,不太清楚啥意思。注意点: 你页面上要有 <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>你可以试试. 不要用Response.Write();你可以定义一个控件,在后台用这个控件的点击方法打开,这样就不会有回传了HyperLink hl_1 = (HyperLink)e.Item.FindControl("hl_1");hl_1.Attributes.Add("onclick", "window.showModalDialog('cust_one.aspx?ID=" + strCust_ID + "','客商信息维护','dialogWidth:800px;dialogHeight:600px;center:true;help:no;resizeable:yes;status:yes'"); 如果就是需要在后台弹出,用下面这种方式吧:ScriptManager.RegisterStartupScript(this, this.GetType(), "EditSuccess", "alert('" + message + "');", true);第三个参数是key,不填也行第四个参数是你的javascript第五个参数是addScriptTags,我一般默认是true,不太清楚啥意思。注意点: 你页面上要有 <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>你可以试试.用下面这种也是可以的:ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('Please Choose Region.')</script>"); 那就不能在GridView1_SelectedIndexChanged事件中去处理 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if(e.Row.RowIndex>=0) { string strCust_ID = e.Row.Cells[2].Text.Trim();//ID e.Row.Attributes.Add("onclick","showModalDialog('cust_one.aspx?ID=" + strCust_ID + "','客商信息维护','dialogWidth:800px;dialogHeight:600px;center:true;help:no;resizeable:yes;status:yes')"); } } 1、弹出提示框代码:ScriptManager.RegisterStartupScript(this.Page, this.GetType(),"onekey", "alert('弹出')", true); 2、 需要在配合UpdatePanel控件使用: a) 在Page_Load方法中用ScriptManager1.RegisterAsyncPostBackControl()来注册一下要实现异步更新的控件 b) 把页面上所有的UpdatePanel控件的UpdateMode设为Conditional。 c) ScriptManager1.RegisterAsyncPostBackControl(this.Button2);实现对Button2的注册。 d) 在Button2控件的Click事件中后面加入后面的代码:UpdatePanel1.Update(); 这样Button2按钮只对UpdatePanel1控件实现的异步的局部刷新。尽量使UpdatePanel1包含的控件少,局部刷新就快。 提示框代码ScriptManager.RegisterStartupScript(this.Page, this.GetType(),"onekey", "alert('弹出')", true);也写在Button2控件的 Click事件中,这样弹出的提示框实质是有部分刷新,但几乎是达到无刷新效果。我试过了,成功了。 ClientScript.RegisterStartupScript()用这个方法注册JS事件就好了,用Response.Write()肯定会刷新的 如何解密表中的某几个列 如何在大量请求时,避免重复select到同一条数据 我在遍历select中的值的时候为什么总是失败?dd1.options[i].value? AjaxPro与Atlas的比较 怎么样实现,页面的多语言功能呢? 解释一C#语句 水晶报表子报表问题!急!!! 高手来看看我这句SQL语句错在那里? 一个分页用户注册的问题,希望有高手帮帮我,谢了 C#中怎么做到这样的stylevar["charset"]下标为字符串的数组? asp.net 页面与控件,变量共享的问题 求教如何控制页面显示
找一个jquery的组件,在后台封装一下。
然后照样在cs代码中调用,前台也不会刷新。
http://www.open-lib.com/Type/175-1.jsp
如果就是需要在后台弹出,用下面这种方式吧:
ScriptManager.RegisterStartupScript(this, this.GetType(), "EditSuccess", "alert('" + message + "');", true);第三个参数是key,不填也行
第四个参数是你的javascript
第五个参数是addScriptTags,我一般默认是true,不太清楚啥意思。注意点: 你页面上要有
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>你可以试试.
你可以定义一个控件,在后台用这个控件的点击方法打开,这样就不会有回传了
HyperLink hl_1 = (HyperLink)e.Item.FindControl("hl_1");
hl_1.Attributes.Add("onclick", "window.showModalDialog('cust_one.aspx?ID=" + strCust_ID + "','客商信息维护','dialogWidth:800px;dialogHeight:600px;center:true;help:no;resizeable:yes;status:yes'");
如果就是需要在后台弹出,用下面这种方式吧:
ScriptManager.RegisterStartupScript(this, this.GetType(), "EditSuccess", "alert('" + message + "');", true);第三个参数是key,不填也行
第四个参数是你的javascript
第五个参数是addScriptTags,我一般默认是true,不太清楚啥意思。注意点: 你页面上要有
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>你可以试试.
用下面这种也是可以的:
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('Please Choose Region.')</script>");
{
if(e.Row.RowIndex>=0)
{
string strCust_ID = e.Row.Cells[2].Text.Trim();//ID e.Row.Attributes.Add("onclick","showModalDialog('cust_one.aspx?ID=" + strCust_ID + "','客商信息维护','dialogWidth:800px;dialogHeight:600px;center:true;help:no;resizeable:yes;status:yes')");
}
}
2、 需要在配合UpdatePanel控件使用:
a) 在Page_Load方法中用ScriptManager1.RegisterAsyncPostBackControl()来注册一下要实现异步更新的控件
b) 把页面上所有的UpdatePanel控件的UpdateMode设为Conditional。
c) ScriptManager1.RegisterAsyncPostBackControl(this.Button2);实现对Button2的注册。
d) 在Button2控件的Click事件中后面加入后面的代码:UpdatePanel1.Update();
这样Button2按钮只对UpdatePanel1控件实现的异步的局部刷新。尽量使UpdatePanel1包含的控件少,局部刷新就快。
提示框代码ScriptManager.RegisterStartupScript(this.Page, this.GetType(),"onekey", "alert('弹出')", true);也写在Button2控件的 Click事件中,这样弹出的提示框实质是有部分刷新,但几乎是达到无刷新效果。我试过了,成功了。