1,页面中显示:
Response.Write(i.ToString ()+"<br>");
2,对话框显示:
Page.RegisterStartupScript("msg", "<script>alert('" + _info + "')<" + "/script>");
Response.Write("<script>alert('"+_info+"')<" + "/script>");
3.提示之后再跳转:
Response.Write("<script>alert('注册成功');window.location='/employee/stulogsuccess.aspx';<" + "/script>");
注:此方法不可用window.history.back()返回;
4.直接跳转:
Response.Redirect("/employee/stulogsuccess.aspx",false);
5.用js跳转:
Response.Write("<script>window.location='/employee/stulogsuccess.aspx';<" + "/script>");
6.带参数跳转:
Response.Redirect("/Controls/error.aspx?msg="+Server.UrlEncode("提交信息没有成功。请与系统管理员联系。"));
本文介绍ASP.NET中常见的页面交互方式,包括使用Response.Write显示消息、利用对话框提示用户、实现页面跳转及带有参数的跳转等实用技巧。
272

被折叠的 条评论
为什么被折叠?



