求c#代码 弹出网页消息框并跳转到某个网页,用一个函数实现 AlertAndRedirect("弹出的消息","要跳转到的"
2个回答
展开全部
public static void AlertAndRedirect(string messageString, string redirectPage)
{
Page currentPage = HttpContext.Current.Handler as Page;
string __Jscript = @"<script>";
__Jscript += @"alert('" + messageString + "');";
__Jscript += @"window.location.href='" + redirectPage + "';</script>";
currentPage.ClientScript.RegisterStartupScript(typeof(System.String), redirectPage.GetHashCode().ToString(), __Jscript);
}
{
Page currentPage = HttpContext.Current.Handler as Page;
string __Jscript = @"<script>";
__Jscript += @"alert('" + messageString + "');";
__Jscript += @"window.location.href='" + redirectPage + "';</script>";
currentPage.ClientScript.RegisterStartupScript(typeof(System.String), redirectPage.GetHashCode().ToString(), __Jscript);
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询