views:

388

answers:

5

Hi folks, I've got realy weird problem on a web page when processing a post back. Here is the error will fallow an explication :

Error : Specified argument was out of the range of valid values. Parameter name: value 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: Specified argument was out of the range of valid values. Parameter name: value

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: Specified argument was out of the range of valid values. Parameter name: value]
System.Web.UI.WebControls.Unit..ctor(String value, CultureInfo culture, UnitType defaultType) +8670188
System.Web.UI.WebControls.Unit.Parse(String s, CultureInfo culture) +31
Infragistics.Web.UI.Framework.ControlObject.ConvertToUnit(Object obj, Unit def, Boolean allowNegative) +399 Infragistics.Web.UI.LayoutControls.WebDialogWindow.get_Top() +74 Infragistics.Web.UI.LayoutControls.DialogWindowBot.LoadClientPropsTransactionList(Dictionary`2 list) +350
Infragistics.Web.UI.Framework.ObjectBase.LoadTransactionList(Boolean deferLoadPostDataProcessing) +57
Infragistics.Web.UI.Framework.RunBot.LoadClientData() +57 Infragistics.Web.UI.Framework.RunBot.HandleLoadPostData(String postDataKey, NameValueCollection postCollection) +14
Infragistics.Web.UI.Framework.ControlMain.LoadPostData(String postDataKey, NameValueCollection postCollection) +19
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +693
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743

Explication

If you look at the stacktrace, we easly see that .NET still aint pass throught my code so i can't put any breakpoint. Something more strange is that for EXACTLY the same process but with differents data (on my page), it works preaty fine. Please help me, im on it for about 3 hours!

UPDATE

I've got to say that, when it fails (for now only 2 objects on somethings like 30 tested), it fails ONLY on a Postback. It become on page that using : Infragistics webdialogwindow and a webcontrol to handles the "visible" like property (Hidden or normal not the size). But as someone said below (sorry don't remember your name), it's for sure regarding to the webdialogwindow but i just DON'T handle the position of it ...

UPDATE 2

We've tried to removed a varchar(max) column's value from database and now it's workin'!! Wow, we don't know what to think because everyting looks to be ok.The problem is that we MUST keep this column's value!!! Anyone know what to think about that? This varchar(max) is shown as a Eval("DescriptionMemo") on a datalist.

+1  A: 

You are calling the constructor for System.Web.UI.WebControls.Unit with an invalid parameter set or somehow initializing this improperly.

Are you setting a unit somewhere on a WebControl in your aspx page?

Chris Ballance
Sorry, maybe i will looks like newbie but what you mean about Unit of Webcontrol ... i saw that like but dunno what to think about that. I've to say that i'm french so its normal if some words looks like nothing to me lol. But first time i get this error.
Simon
@Simon What value are you sending as the Unit?
Chris Ballance
I don't pass any unit to anything ... but yeah for sure on the page, but for all controls who using all the same control on different request, always the SAME fails when other works...
Simon
Please add your aspx page markup to the question.
Chris Ballance
I can't its quite too long!! It's an asp.net page plus a .ascx.
Simon
A: 

According to MSDN, ArgumentOutOfRangeException is thrown by the Unit class's constructor when the value argument is out of range (not between -32768 and 32767). Somehow, that's the value being passed to that element on the page.

Now, you've said that you are passing different values in different requests and that those requests work. What are the values that you are passing that work? What are the values that you pass that fail?

EDIT: I see that you are using the Infragistics WebDialogWindow, and that you're trying to get the topmost coordinate of the dialog. THAT is the coordinate that is off. It's outside the valid range of values for the Unit class. The big question now is why is that the case?

Mike Hofer
Wow! And it make all .net fails to an error? Why its not only a Javascript Error?
Simon
Because it's happening on the *server*, before the page is rendered on the browser.
Mike Hofer
At this point, none of the HTML has even been rendered; .NET is still trying to put together all the classes it needs to decide how to create the page. But it *can't* create the classes, because one of them has an invalid constructor parameter.
Mike Hofer
And why some work when other not?
Simon
+1  A: 

My guess is that your are sending something it can't parse:

System.Web.UI.WebControls.Unit..ctor(String value, CultureInfo culture, UnitType defaultType)

How to: Set Web Server Control Unit Properties

rick schott
Yeah that what i'm thinkg about, but all what page have time to do its OnInit(); events. After what it fails
Simon
Simon, are you *moving* the WebDialogWindow using a formula?
Mike Hofer
Can you post some code? I think everyone so far knows why you have an error, but we can't tell you what to fix without seeing something.
rick schott
I will explain more on my main post. But i can't post all my code because there's for sure TOO MUCH and its not "my code" who's bugging, it fails before going in.
Simon
A: 

Wowwwww! It's ok! All I can say is : If you'r using Infragistics webdialogwindow with IntialLocation set to "Centered". Put it at the top of your page (It's a "popup" anyway so it "over" your page content). Because my problem were that when the page having, says more that 32000px lenght(dunno the exact length) popup were unabled to locate correctly the window cuz it can't put it in a int32... wow. What a bug

Simon
+1  A: 

Given your update, here's an educated guess.

I don't know much about the Infragistics WebDialog componen, but most dialogs are centered on the page. If your column has anything to do with the positioning of the dialog, it may be calculating the position of the dialog based on the size of the data that is being displayed.

If the data is too large to display, that may put the dialog at a position that is theoretically outside the bounds of the Unit class's acceptable range of values.

If the column is hidden, everything is fine, because the dialog would fit on the window, and the coordinates (specifically, the Top coordinate, as shown in your stack trace) would be negative. If it's displayed, the dialog would not, because it would stretch beyond the confines of the browser window.

That's all just theory and speculation, but it's based on what we can see here.

Mike Hofer
No, your totaly right. Because the popup were dropped at the bottom of the page because it don't care anywhere it was on the page (anyway its a popup), so when it tries to "centered" it and the page display a lot of data (and thats exactly the problem I were having because it caught "occasionnaly" the error) it fails to an incompatible convertion for a short (-32767 and +32767)
Simon
Glad I could help! It's interesting that the Unit class takes an Int32 as an argument, and then throws when the arguments are outside the bounds for a Short, though. I'll have to pester Jon Skeet about that.
Mike Hofer
Yea, it means 2 person and like 4hours each to solve a problem hard to find :o( and not of our fault.
Simon