Redirect if a page has querystring to same address with out query string.
protected void Page_PreInit(object sender, EventArgs e)
{
if (Request.QueryString.Count > 0)
{
Response.Redirect(Request.Url.AbsolutePath);
//Response.Write("AbsolutePath" + Request.Url.AbsolutePath);
//Response.Write("
AbsoluteUri" + Request.Url.AbsoluteUri);
//Response.Write("
PathAndQuery" + Request.Url.PathAndQuery);
//Response.Write("
Query" + Request.Url.Query);
//Response.Write("test" + Request["test"]);
}
}
protected void Page_PreInit(object sender, EventArgs e)
{
if (Request.QueryString.Count > 0)
{
Response.Redirect(Request.Url.AbsolutePath);
//Response.Write("AbsolutePath" + Request.Url.AbsolutePath);
//Response.Write("
AbsoluteUri" + Request.Url.AbsoluteUri);
//Response.Write("
PathAndQuery" + Request.Url.PathAndQuery);
//Response.Write("
Query" + Request.Url.Query);
//Response.Write("test" + Request["test"]);
}
}
No comments:
Post a Comment