473,385 Members | 2,274 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,385 software developers and data experts.

Length cannot be less than zero

Hi,

I have developed an asp.net application that uses forms authentication.
I have a local install and a remotely hosted install of the application.
Intermittently the remote application falls over with an error (see
below for details).

This seems to happen on different pages after an asp forms button is
clicked, and brings down the whole application when it does happen. When
it happens you cannot browse to any page within the application (even
the front login page).

As a temporary fix, the hosting company restarts the application pool
and/or web service.

This seems to be happening approximately once or twice a day.

Here is a screen dump of the error.....

Any help as to the cause, would be greatly appreciated!

Server Error in '/vs24100_secure/coc_admin' Application.
------------------------------------------------------------------------
--------

Length cannot be less than zero. Parameter name: length
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Length cannot be
less than zero. Parameter name: length

Source Error:

An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:
[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
System.String.Substring(Int32 startIndex, Int32 length) +172
System.Web.UI.Util.GetScriptLocation(HttpContext context) +200

System.Web.UI.WebControls.BaseValidator.RegisterVa lidatorCommonScript()
+69
System.Web.UI.WebControls.BaseValidator.OnPreRende r(EventArgs e) +44
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Page.ProcessRequestMain() +1489


------------------------------------------------------------------------
--------
Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 9334
I think I may have fixed it myself. I made the following change to all
my pages with validation controls last week, and so far the application
hasn't fallen over. (It had been failing at least once a day).

I have changed all validation controls to include
'enableclientscript=false' which means that the page will postback to
the server to verify that validation is correct, rather than doing it
all client-side.

I noticed that the 'BaseValidator.OnPreRender' was listed in the stack
trace. I discovered that this method allows you to change the viewstate
before it is rendered on the page...this would probably have something
to do with client/server side validation?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

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

Similar topics

31
by: RS | last post by:
Hi, Looking to see if the following construct is valid: typedef struct { int foo; char bar; } foobar; Basically, the idea is to have the structure above point to a message buffer that has...
1
by: Guadala Harry | last post by:
What do to about conversion to decimal type when blank is allowed? The situation is this. In the UI there is a textbox into which users can enter a value which is supposed to be a dollar amount....
0
by: John Mason | last post by:
Hi, I have developed an asp.net application that uses forms authentication. I have a local install and a remotely hosted install of the application. Intermittently the remote application falls...
1
by: Hozi | last post by:
I am getting the below error when asp.net tries to parse the .aspx file. The funny part is that the error only seems to be happening when viewing the page throuh IE 6 and not Netscape browsers. I...
4
by: Randall Parker | last post by:
I am designing a database schema. It happens to be in MySQL but I'm trying to keep it portable to other databases should the project grow. Anyway, suppose you have VARCHAR fields and will be...
10
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/acfctNZ_HV05186465.asp "If the value of the variant argument is Null, the Nz function returns the number zero or a...
2
by: manmit.walia | last post by:
Hello All and Thank You for your time, I am stuck on this exception handleing error. The problem is that when I run my application the application works perfect but sometimes, I get this error. I...
0
by: SYED HANIF | last post by:
A couple of days ago, my hosting provider upgraded the .Net framework to .Net 1.1 SP1. Since then I am experincing strange errors: some of the aspx pages suddenly an exception on the initial...
3
by: Coll | last post by:
I inherited a database. On one of the forms, a bunch of fields on the form are to be updated with data from a combo box containing many columns after one particular field is updated. I'm receiving...
3
by: angi35 | last post by:
I'm having a zero-length string problem... Hoping someone can help. (This is in Access 2000.) In FormA, I have a button that opens FormB with OpenArgs. In FormB, the OpenArgs are translated into...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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.