473,769 Members | 3,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Overflow Exception during IPostBackDataHa ndler.LoadPostD ata

During my postbacks, I try to assign the value from an Input tag to a
property of a custom control. However, I keep recieving the following error:
An exception of type 'System.Overflo wException' occurred in
Microsoft.Visua lBasic.dll but was not handled in user code
Additional information: Arithmetic operation resulted in an overflow.
The code that it highlights during this error is the 2nd line of the
following (Me.Value = postCollection( Me.ID & "_currvalue ")):
Public Function LoadPostData(By Val postDataKey As String, ByVal
postCollection As NameValueCollec tion) As Boolean Implements
IPostBackDataHa ndler.LoadPostD ata
Me.Value = postCollection( Me.ID & "_currvalue ")
Return True
End Function
I will admit that this is my first time using the IPostBackDataHa ndler
interface, but 'System.Overflo wException' seems like a very strange
exception for this part of my code, since I am just doing a String
concatenation and an assignment. The value associated with this
postCollection key is a positive integer (well, a string actually, but it
has no negative signs or decimal places, just a couple digits) and Me.Value
is a Property of my Control that is of type Integer, so it shouldn't have
any problem converting, right? If anybody has any ideas as to where I might
be going wrong here, or where I could look to help find the problem, I would
appreciate it. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Jul 20 '06 #1
4 1659
What does the Value property and RaisePostDataCh anged method (another method
of IPostBackDataHa ndler) look like? If the code isn't long oner, post entire
control's sources.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
During my postbacks, I try to assign the value from an Input tag to a
property of a custom control. However, I keep recieving the following
error:
An exception of type 'System.Overflo wException' occurred in
Microsoft.Visua lBasic.dll but was not handled in user code
Additional information: Arithmetic operation resulted in an overflow.
The code that it highlights during this error is the 2nd line of the
following (Me.Value = postCollection( Me.ID & "_currvalue ")):
Public Function LoadPostData(By Val postDataKey As String, ByVal
postCollection As NameValueCollec tion) As Boolean Implements
IPostBackDataHa ndler.LoadPostD ata
Me.Value = postCollection( Me.ID & "_currvalue ")
Return True
End Function
I will admit that this is my first time using the IPostBackDataHa ndler
interface, but 'System.Overflo wException' seems like a very strange
exception for this part of my code, since I am just doing a String
concatenation and an assignment. The value associated with this
postCollection key is a positive integer (well, a string actually, but it
has no negative signs or decimal places, just a couple digits) and
Me.Value is a Property of my Control that is of type Integer, so it
shouldn't have any problem converting, right? If anybody has any ideas as
to where I might be going wrong here, or where I could look to help find
the problem, I would appreciate it. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Jul 20 '06 #2
Here is the code for the Value property:
<Description("T he value that the Slider is currently set to")>
<DefaultValue(" 0")_
Public Property Value() As Integer
Get
If IsNothing(ViewS tate("value")) Then Return 0 Else Return
ViewState("valu e")
End Get
Set(ByVal value As Integer)
ViewState("valu e") = value
End Set
End Property
And here is the code for the RaisePostDataCh angedEvent method:
Public Sub RaisePostDataCh angedEvent() Implements
IPostBackDataHa ndler.RaisePost DataChangedEven t
End Sub
The only code in my OnPreRender method other than the creating of the
client-side scripts, which I do using String concatenation and the
Page.ClientScri pt.RegisterClie ntScriptBlock method, is setting the only
global variable I have, which is declared as Private pixeltovalue As
Decimal, as follows:
Me.pixeltovalue = (Me.Width - 48) / (Me.MaxValue - Me.MinValue)
My Render method just uses the basic methods of the HtmlTextWriter class.
The only arithmetic operations in my OnPreRender and Render methods are very
simple addition, subtraction, multiplication, and division. I did not think
it was worth pasting all my code into this message (although I can if you
really think it will help you solve the problem), since almost all of it is
property declarations, all of which look exactly the same as the one above,
String concatenation while building the JavaScript functions, and the basic
HtmlTextWriter methods used to create the html tags; the only other code in
my control is the IPostBackDataHa ndler implementation and the
Me.pixeltovalue declaration and assignment that I showed above. Any ideas as
to what the problem might be? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Teemu Keiski" <jo****@aspalli ance.comwrote in message
news:Ob******** ******@TK2MSFTN GP02.phx.gbl...
What does the Value property and RaisePostDataCh anged method (another
method of IPostBackDataHa ndler) look like? If the code isn't long oner,
post entire control's sources.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>During my postbacks, I try to assign the value from an Input tag to a
property of a custom control. However, I keep recieving the following
error:
An exception of type 'System.Overflo wException' occurred in
Microsoft.Visu alBasic.dll but was not handled in user code
Additional information: Arithmetic operation resulted in an overflow.
The code that it highlights during this error is the 2nd line of the
following (Me.Value = postCollection( Me.ID & "_currvalue ")):
Public Function LoadPostData(By Val postDataKey As String, ByVal
postCollecti on As NameValueCollec tion) As Boolean Implements
IPostBackDataH andler.LoadPost Data
Me.Value = postCollection( Me.ID & "_currvalue ")
Return True
End Function
I will admit that this is my first time using the IPostBackDataHa ndler
interface, but 'System.Overflo wException' seems like a very strange
exception for this part of my code, since I am just doing a String
concatenatio n and an assignment. The value associated with this
postCollecti on key is a positive integer (well, a string actually, but it
has no negative signs or decimal places, just a couple digits) and
Me.Value is a Property of my Control that is of type Integer, so it
shouldn't have any problem converting, right? If anybody has any ideas as
to where I might be going wrong here, or where I could look to help find
the problem, I would appreciate it. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/


Jul 20 '06 #3
Hi,

could it be that the

Me.Value = postCollection( Me.ID & "_currvalue ")

would be so big number it doesn't fit to the value? (32-bit Integer). Where
does this value come from? Is it calculated, entered by user?
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:OW******** ******@TK2MSFTN GP02.phx.gbl...
Here is the code for the Value property:
<Description("T he value that the Slider is currently set to")>
<DefaultValue(" 0")_
Public Property Value() As Integer
Get
If IsNothing(ViewS tate("value")) Then Return 0 Else Return
ViewState("valu e")
End Get
Set(ByVal value As Integer)
ViewState("valu e") = value
End Set
End Property
And here is the code for the RaisePostDataCh angedEvent method:
Public Sub RaisePostDataCh angedEvent() Implements
IPostBackDataHa ndler.RaisePost DataChangedEven t
End Sub
The only code in my OnPreRender method other than the creating of the
client-side scripts, which I do using String concatenation and the
Page.ClientScri pt.RegisterClie ntScriptBlock method, is setting the only
global variable I have, which is declared as Private pixeltovalue As
Decimal, as follows:
Me.pixeltovalue = (Me.Width - 48) / (Me.MaxValue - Me.MinValue)
My Render method just uses the basic methods of the HtmlTextWriter class.
The only arithmetic operations in my OnPreRender and Render methods are
very simple addition, subtraction, multiplication, and division. I did not
think it was worth pasting all my code into this message (although I can
if you really think it will help you solve the problem), since almost all
of it is property declarations, all of which look exactly the same as the
one above, String concatenation while building the JavaScript functions,
and the basic HtmlTextWriter methods used to create the html tags; the
only other code in my control is the IPostBackDataHa ndler implementation
and the Me.pixeltovalue declaration and assignment that I showed above.
Any ideas as to what the problem might be? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Teemu Keiski" <jo****@aspalli ance.comwrote in message
news:Ob******** ******@TK2MSFTN GP02.phx.gbl...
>What does the Value property and RaisePostDataCh anged method (another
method of IPostBackDataHa ndler) look like? If the code isn't long oner,
post entire control's sources.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:%2******* *********@TK2MS FTNGP05.phx.gbl ...
>>During my postbacks, I try to assign the value from an Input tag to a
property of a custom control. However, I keep recieving the following
error:
An exception of type 'System.Overflo wException' occurred in
Microsoft.Vis ualBasic.dll but was not handled in user code
Additional information: Arithmetic operation resulted in an overflow.
The code that it highlights during this error is the 2nd line of the
following (Me.Value = postCollection( Me.ID & "_currvalue ")):
Public Function LoadPostData(By Val postDataKey As String, ByVal
postCollectio n As NameValueCollec tion) As Boolean Implements
IPostBackData Handler.LoadPos tData
Me.Value = postCollection( Me.ID & "_currvalue ")
Return True
End Function
I will admit that this is my first time using the IPostBackDataHa ndler
interface, but 'System.Overflo wException' seems like a very strange
exception for this part of my code, since I am just doing a String
concatenati on and an assignment. The value associated with this
postCollectio n key is a positive integer (well, a string actually, but
it has no negative signs or decimal places, just a couple digits) and
Me.Value is a Property of my Control that is of type Integer, so it
shouldn't have any problem converting, right? If anybody has any ideas
as to where I might be going wrong here, or where I could look to help
find the problem, I would appreciate it. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/



Jul 21 '06 #4
No, that was not the problem, but I found that in my client-side JavaScript
I needed to explicitly convert a text value to a Number, I was ending up
with a value like "25-1" being sent to the server instead of 24, but thanks
for your help anyway.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Teemu Keiski" <jo****@aspalli ance.comwrote in message
news:Ob******** ******@TK2MSFTN GP04.phx.gbl...
Hi,

could it be that the

Me.Value = postCollection( Me.ID & "_currvalue ")

would be so big number it doesn't fit to the value? (32-bit Integer).
Where does this value come from? Is it calculated, entered by user?
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:OW******** ******@TK2MSFTN GP02.phx.gbl...
>Here is the code for the Value property:
<Description(" The value that the Slider is currently set to")>
<DefaultValue( "0")_
Public Property Value() As Integer
Get
If IsNothing(ViewS tate("value")) Then Return 0 Else Return
ViewState("val ue")
End Get
Set(ByVal value As Integer)
ViewState("valu e") = value
End Set
End Property
And here is the code for the RaisePostDataCh angedEvent method:
Public Sub RaisePostDataCh angedEvent() Implements
IPostBackDataH andler.RaisePos tDataChangedEve nt
End Sub
The only code in my OnPreRender method other than the creating of the
client-side scripts, which I do using String concatenation and the
Page.ClientScr ipt.RegisterCli entScriptBlock method, is setting the only
global variable I have, which is declared as Private pixeltovalue As
Decimal, as follows:
Me.pixeltovalu e = (Me.Width - 48) / (Me.MaxValue - Me.MinValue)
My Render method just uses the basic methods of the HtmlTextWriter class.
The only arithmetic operations in my OnPreRender and Render methods are
very simple addition, subtraction, multiplication, and division. I did
not think it was worth pasting all my code into this message (although I
can if you really think it will help you solve the problem), since almost
all of it is property declarations, all of which look exactly the same as
the one above, String concatenation while building the JavaScript
functions, and the basic HtmlTextWriter methods used to create the html
tags; the only other code in my control is the IPostBackDataHa ndler
implementati on and the Me.pixeltovalue declaration and assignment that I
showed above. Any ideas as to what the problem might be? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Teemu Keiski" <jo****@aspalli ance.comwrote in message
news:Ob******* *******@TK2MSFT NGP02.phx.gbl.. .
>>What does the Value property and RaisePostDataCh anged method (another
method of IPostBackDataHa ndler) look like? If the code isn't long oner,
post entire control's sources.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:%2****** **********@TK2M SFTNGP05.phx.gb l...
During my postbacks, I try to assign the value from an Input tag to a
property of a custom control. However, I keep recieving the following
error:
An exception of type 'System.Overflo wException' occurred in
Microsoft.Vi sualBasic.dll but was not handled in user code
Additional information: Arithmetic operation resulted in an overflow.
The code that it highlights during this error is the 2nd line of the
following (Me.Value = postCollection( Me.ID & "_currvalue ")):
Public Function LoadPostData(By Val postDataKey As String, ByVal
postCollecti on As NameValueCollec tion) As Boolean Implements
IPostBackDat aHandler.LoadPo stData
Me.Value = postCollection( Me.ID & "_currvalue ")
Return True
End Function
I will admit that this is my first time using the IPostBackDataHa ndler
interface, but 'System.Overflo wException' seems like a very strange
exception for this part of my code, since I am just doing a String
concatenatio n and an assignment. The value associated with this
postCollecti on key is a positive integer (well, a string actually, but
it has no negative signs or decimal places, just a couple digits) and
Me.Value is a Property of my Control that is of type Integer, so it
shouldn't have any problem converting, right? If anybody has any ideas
as to where I might be going wrong here, or where I could look to help
find the problem, I would appreciate it. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/



Jul 21 '06 #5

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

Similar topics

2
3282
by: John Burke | last post by:
I am getting a curious problem where LoadPostData is not being called after registering the control using RegisterRequiresPostback. Other controls not requiring postback registration are having LoadPostData called. Each control calling RegisterRequiresPostback does have a uniqueid and exists for the lifetime of the page, so it's not a mis-referencing problem. It's worth noting that this was working fine until I killed the Viewstate and...
0
431
by: One Handed Man \( OHM - Terry Burns \) | last post by:
I have implemented the System.Web.UI.IPostBackDataHandler.LoadPostData interface in my custom control, however, when I submit this Function is not called by ASP.NET ( Which is what I assume is supposed to happen ). Unfortunately it does not get called, any ideas what could be causing this ? --
9
2373
by: brian.mills | last post by:
I've been building some custom controls which have some special functionality with the data I use from a web service, specifically the ability to data bind to attributes (without an accessor method). However I've come accross an interesting issue with using them. I have reimplemented the class from public class WCCombobox : Control, IPostBackDataHandler so that I can load the post data back in. It works great, it gets to the method and...
0
908
by: Martin Gustavsson | last post by:
I'm a bit puzzled by the IPostBackDataHandler. What if i have a custom control that I render myself, and I render 30 input-fields. They can't all have the name of the control's UniqueID? Which is required if LoadPostData is to be invoked (Note: Theese are not child controls, they are simply rendered input-fields). My input fields will probably be named something like UniqueID + ":some_internal_id". One solution I can come up with is to...
8
1871
by: Nathan Sokalski | last post by:
I have a System.Web.UI.HtmlControls.HtmlInputFile control that I use to submit files. After the file is successfully submitted, I want the field to be reset so that the user knows the file was submitted. However, ASP.NET does not let you change the Value property of an HtmlInputFile control. How can I reset the HtmlInputFile control to it's original state? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
4
1110
by: Nathan Sokalski | last post by:
During my postbacks, I try to assign the value from an Input tag to a property of a custom control. However, I keep recieving the following error: An exception of type 'System.OverflowException' occurred in Microsoft.VisualBasic.dll but was not handled in user code Additional information: Arithmetic operation resulted in an overflow. The code that it highlights during this error is the 2nd line of the
0
1274
by: mankuipeng | last post by:
I am doing ActiveReports with .NET environment. There is a ASP.NET page, with custom control on it. Control displays data from database, by editing all the necessary data and click 'Submit' button to render ActiveReport. When I click 'Submit' button. LoadPostData and RaisePostBackEvent in custom control occurs, then Page_Load, then Render. It should stop at this point but sometimes LoadPostData and RaisePostBackEvent fire many times...
4
3459
by: stevencheng_2007 | last post by:
I got a CER from a client said that a system.overflowexception thrown when executing the following stentence: Vertor3 v = p1 - p2; Here the p1, p2 are variables of self defined struct --- Point3, Vector3 is also a self defined struct type, they are definitions as below: struct Point3 struct Vector3 { { float x, y, z;
7
16346
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am using this code to get groups for a user and getting a error (5) on the GetAuthorizationGroups() function . There are two domains. This function works on the local domain but does not work on the other domain. Other functions work on the other domain like get all the users and get all the groups and I can validate users on the other domain so I think I am communciating with the other domain OK just not with the...
0
9424
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.