if (!IsPostBack)
 {
                //如果请求ID为空,则重写URL为:~/index.aspx?ID=shouji.115sou.com
                if (Request.QueryString["ID"]==null || Request.QueryString["ID"].Trim()=="")
                {
                    HttpContext.Current.RewritePath("~/index.aspx?ID=shouji.115sou.com");
                }

                Response.Write(Request.QueryString["ID"]);
 }

  

  Name Description
RewritePath(String) 重写URL的路径
RewritePath(String, Boolean) 重写URL路径和一个布尔值,指定是否服务器资源虚拟路径的修改
RewritePath(String, String, String) 重写URL通过使用给定的路径路径信息和查询字符串信息
RewritePath(String, String, String, Boolean) 重写URL使用给定的虚拟路径路径信息查询字符串信息一个布尔值,指定是否客户端文件路径设置为重写路径

相关文章:

  • 2022-12-23
  • 2021-05-23
  • 2022-12-23
  • 2021-07-19
  • 2021-11-12
  • 2021-08-04
猜你喜欢
  • 2021-05-30
  • 2022-02-08
  • 2022-01-30
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案