记录下代码:
public static void Alert(string alert)
{
System.Web.HttpContext.Current.Response.Write("<script>alert('"+alert+"');</script>");
}
//弹出提示后确定跳转
public static void AlertJump(string alert, string url)
{
System.Web.HttpContext.Current.Response.Write("<script>alert('" + alert + "');window.location='" + url + "';</script>");
}
本文介绍了一种在 ASP.NET 应用中实现弹出消息提示及页面跳转的方法,通过简单的 C# 代码片段实现了自定义的 Alert 和 AlertJump 方法,方便开发者在实际项目中使用。
899

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



