W
Wayne Sepega
In our web application we have a routine that will take a URL and encrypt
the query string portion of it. We are doing this in the Global.asax in
Application_EndRequest, we have done this in 1.1 and I am currently using
the same code in my 2.0 application.
protected void Application_BeginRequest(Object sender, EventArgs e)
{
Response.Filter = new UrlEncryptFilter(this.Response.Filter); // Encypts
any URL on the page that has a query string.
if (this.Request.QueryString["eqs"] != null) //Check to see if the if the
request URL was encoded.
{
// Unencrypt the query string
string queryString = Decode(this.Request.QueryString["eqs"]); //Decode
the request query string
Context.RewritePath(this.Request.Path, this.Request.PathInfo,
queryString);
}
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
if (this.Response.RedirectLocation == null)
return;
string oldUrl = this.Response.RedirectLocation;
int i = oldUrl.IndexOf('?') + 1;
if (i > 0 && oldUrl.Length > i + 1)
Response.RedirectLocation = string.Concat(oldUrl.Substring(0, i),
"eqs=", Encode(oldUrl.Substring(i)));
}
If this code is in place when I pull up some, not all, forms in my web
application I receive the following error in the browser:
Line: 915
Char: 1
Error WebForm_SaveS croilPositionSubmit' is undeFined
Code: 0
URL: http://localhost/LoadAlerts/Alerts_Add.aspx
Line 915 contains:
theForm.submit = WebForm_SaveScrollPositionSubmit;
This occurs even if there isn't any thing to be encrypted on the page. I've
taken the resulting page and saved the source both encrypted and not
encrypted, when there are no links on the page to be encyrpted the source is
identical.
Any help would be appreciated. Let me know if I need to supply any further
information.
Thanks
Wayne Sepega
the query string portion of it. We are doing this in the Global.asax in
Application_EndRequest, we have done this in 1.1 and I am currently using
the same code in my 2.0 application.
protected void Application_BeginRequest(Object sender, EventArgs e)
{
Response.Filter = new UrlEncryptFilter(this.Response.Filter); // Encypts
any URL on the page that has a query string.
if (this.Request.QueryString["eqs"] != null) //Check to see if the if the
request URL was encoded.
{
// Unencrypt the query string
string queryString = Decode(this.Request.QueryString["eqs"]); //Decode
the request query string
Context.RewritePath(this.Request.Path, this.Request.PathInfo,
queryString);
}
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
if (this.Response.RedirectLocation == null)
return;
string oldUrl = this.Response.RedirectLocation;
int i = oldUrl.IndexOf('?') + 1;
if (i > 0 && oldUrl.Length > i + 1)
Response.RedirectLocation = string.Concat(oldUrl.Substring(0, i),
"eqs=", Encode(oldUrl.Substring(i)));
}
If this code is in place when I pull up some, not all, forms in my web
application I receive the following error in the browser:
Line: 915
Char: 1
Error WebForm_SaveS croilPositionSubmit' is undeFined
Code: 0
URL: http://localhost/LoadAlerts/Alerts_Add.aspx
Line 915 contains:
theForm.submit = WebForm_SaveScrollPositionSubmit;
This occurs even if there isn't any thing to be encrypted on the page. I've
taken the resulting page and saved the source both encrypted and not
encrypted, when there are no links on the page to be encyrpted the source is
identical.
Any help would be appreciated. Let me know if I need to supply any further
information.
Thanks
Wayne Sepega