473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Java script error when URL's modified in Application_EndRequest and Application_BeginRequest

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
Jan 5 '06 #1
1 2239
After much time, effort and help from a co-worker, we've found the issue.

ASP.net 2.0 generates the following in my web page:

<script
src="/LoadAlerts/WebResource.axd?d=S462ZtHX1VAIPXUpdJLd4Q2&amp;t=63 2663465369687500"
type="text/javascript"></script>
<script
src="/LoadAlerts/WebResource.axd?d=7eM4r3f83vmLH-iLPspbfw2&amp;t=632663465369687500"
type="text/javascript"></script>
I have this in my global ASAX in the on begin request:

Response.Filter = new UrlEncryptFilter(this.Response.Filter);

When the page is loaded the above Scripts are requested, for some reason yet
unkown, the java script is striped by our filter. I'm going to add an if to
make sure that the requested page has an .aspx extention.

Thanks

Wayne
Jan 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of...
0
by: Tim::.. | last post by:
Hi, Can someone please tell me why I get this error when I try to build my ASP.NET application??? Could not load type 'CPNNet.Global'. Line 1: <%@ Application Codebehind="Global.asax.vb"...
1
by: sam | last post by:
Hi, I have seen many posts about this problem and no resolution. I have set the maxRequestLength to 200K as I don't want anyone uploading files to the server greater than this size. I have...
14
by: Roland Hall | last post by:
Since I'm not getting any response from the community, I'm reposting this under my managed account. I've turned my web.config friendly error messages off and it may be easier to view what I'm...
6
by: Ian Davies | last post by:
Hello I have found the following script php/java for dynamic menu lists. Where a selection from the first updates (filters items in) the other. I have modified it for my tables. However I am...
33
by: patrick_woflian | last post by:
hey guys, im just writing a basic calculation at the moment, before building on it for an A-Level piece of work. i can add/divide etc... two numbers together yet i am having a major problem with...
0
by: John | last post by:
I am writing a custom httpmodule, I can catch BeginRequest, EndRequest event, But I can not catch Error event, I tried throwing an error from my Web Service, creating a security exception (by...
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
5
by: rote | last post by:
I'm using ASP.NET 2.0 and i have copied and pasted the code below to my Global.asax file but it desn't trap the error I want to trap the 401 access denied void Application_Error(object sender,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.