日期:2014-05-18  浏览次数:20535 次

做个提示框,当点击确定后,转到另一页面
如题         我做的提示框没显示     直接显示另一页面了  
if   (Session[ "uname "]   ==   null)
{
    CStatic.GetScript( "您现在还没登陆,没有权限查看任何东西,请登陆后查看! ")
    Response.Redirect( "/default.aspx ");
}

着是代码  
我的CStatice.GetScript方法是这样写的
public   static   void   GetScript(string   strCon)
  {
      HttpContext.Current.Response.Write( " <script> window.alert( ' "   +   strCon   +   " '); < "   +   "/script> ");
  }

请问我该怎么写代码呢?

------解决方案--------------------
上边的错了

if (Session[ "uname "] == null)
{
CStatic.GetScript( "您现在还没登陆,没有权限查看任何东西,请登陆后查看! ", "/default.aspx ");}


public static void GetScript(string strCon,string url)
{
HttpContext.Current.Response.Write( " <script> window.alert( ' " + strCon + " ');window.location.href= " + url + "; </script> ");
}