Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Saturday, March 31, 2012

System.InvalidCastException:

I have a page that gets a value from the querystring. I believe people click certain javascript functions on the page that sometimes appends a "#". I have never seen a page error out to this, but I am getting my logfile full of errors like the one below?

System.InvalidCastException: Cast from string "146586#" to type 'Integer' is not valid.

What would be a good way to stop this? Should I somehow trim the very last character if its equal to a "#" .

If so, how can I achieve this?

Thanks
mike123That is weird. The only time I have seen a # appended is when somebody uses the onclick in a A tag

for instance:Click me

In my opinion and to avoid these @.$R # signs is to use this:

Click Me

Thursday, March 22, 2012

System.NullReferenceException:

i have a radiobuttonlist. I want to check to see if a button has been
selected then get the value.. This was my code;

--------------------

Dim NewGender as String
if (Gender.SelectedItem.Value <> "") then
NewGender = Gender.SelectedItem.Value

else

NewGender = ""

end if

If nothing is selected, I get the following error..

System.NullReferenceException: Object reference not set to an instance
of an object.

thank in advance..Yes, if no item is selected then you get the error. Wouldn't you expect to
get it if you are checking the Value property of SelectedItem, but
SelectedItem is null?
What is your question exactly?

"Brian" <bciarcia@.pepehazard.com> wrote in message
news:1112200428.271311.212350@.l41g2000cwc.googlegr oups.com...
>i have a radiobuttonlist. I want to check to see if a button has been
> selected then get the value.. This was my code;
> --------------------
> Dim NewGender as String
> if (Gender.SelectedItem.Value <> "") then
> NewGender = Gender.SelectedItem.Value
> else
> NewGender = ""
> end if
> If nothing is selected, I get the following error..
> System.NullReferenceException: Object reference not set to an instance
> of an object.
> thank in advance..
I needed to check if there was a value or not, so I wouldn't get an
error when I posted the value..

I figured it out though.. i needed to to Gender.SelectedValue.. I am
kinda new to this, so I am still learning.. Thanks for your response..

*** Sent via Developersdex http://www.developersdex.com ***
Hi Brian,

1. You can set a default value for radiobuttonlist.

2. Or you can

If Not Gender.SelectedItem Is Nothing Then
if (Gender.SelectedItem.Value <> "") then
' ...

End If

HTH

Elton Wang
elton_wang@.hotmail.com

>--Original Message--
>i have a radiobuttonlist. I want to check to see if a
button has been
>selected then get the value.. This was my code;
>------------------
--
>Dim NewGender as String
>if (Gender.SelectedItem.Value <> "") then
>NewGender = Gender.SelectedItem.Value
>else
>NewGender = ""
>end if
>If nothing is selected, I get the following error..
>System.NullReferenceException: Object reference not set
to an instance
>of an object.
>thank in advance..
>.
Brian,

I've been doing some research on radiobuttonlists and from what i've read
and the examples i've looked at, i have not yet found a way to handle an
"unselected" radiobuttonlist.

Are you trying to update a database or just trying to display what the user
has selected?

Also, i'd be interested to know if you have found a way to update a
database (even if it's a null value) if no items in a radiobuttonlist have
been selected.

Thanks.

--
Message posted via http://www.dotnetmonster.com

System.NullReferenceException:

i have a radiobuttonlist. I want to check to see if a button has been
selected then get the value.. This was my code;
---
Dim NewGender as String
if (Gender.SelectedItem.Value <> "") then
NewGender = Gender.SelectedItem.Value
else
NewGender = ""
end if
If nothing is selected, I get the following error..
System.NullReferenceException: Object reference not set to an instance
of an object.
thank in advance..Yes, if no item is selected then you get the error. Wouldn't you expect to
get it if you are checking the Value property of SelectedItem, but
SelectedItem is null?
What is your question exactly?
"Brian" <bciarcia@.pepehazard.com> wrote in message
news:1112200428.271311.212350@.l41g2000cwc.googlegroups.com...
>i have a radiobuttonlist. I want to check to see if a button has been
> selected then get the value.. This was my code;
> ---
> Dim NewGender as String
> if (Gender.SelectedItem.Value <> "") then
> NewGender = Gender.SelectedItem.Value
> else
> NewGender = ""
> end if
> If nothing is selected, I get the following error..
> System.NullReferenceException: Object reference not set to an instance
> of an object.
> thank in advance..
>
I needed to check if there was a value or not, so I wouldn't get an
error when I posted the value..
I figured it out though.. i needed to to Gender.SelectedValue.. I am
kinda new to this, so I am still learning.. Thanks for your response..
*** Sent via Developersdex http://www.examnotes.net ***
Brian,
I've been doing some research on radiobuttonlists and from what i've read
and the examples i've looked at, i have not yet found a way to handle an
"unselected" radiobuttonlist.
Are you trying to update a database or just trying to display what the user
has selected?
Also, i'd be interested to know if you have found a way to update a
database (even if it's a null value) if no items in a radiobuttonlist have
been selected.
Thanks.
Message posted via http://www.webservertalk.com

System.NullReferenceException: Object reference not set to an instance of an object.

I am getting the following error message when I am trying to calculate the value of textboxes. What am I doing wrong?

System.NullReferenceException: Object reference not set to an instance of an object.
line: finalVal = finalVal + Convert.ToInt64(strAI.Text)
Code--------

' Grab the textbox values of the interest cost table, loop through them adding up the values and displaying the totals

PrivateSub btnInterestCostTotal_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles btnInterestCostTotal.Click

'AddField(DS_Term.Text)

Dim C, NAsInteger

'Find the txtAnnualInterestTotal textbox

Dim AITAs TextBox =CType(myTable.FindControl("txtAnnualInterestTotal"), TextBox)

Dim finalValAs Int64 = 0

'Loop through the dynamic textboxes

For C = 0ToCInt(DS_Term.Text) - 1

N = N + 1

Dim strAIAs TextBox =CType(myTable.FindControl("txtAnnualInterest" & N), TextBox)

'Add all the dynamic textboxes up

finalVal = finalVal + Convert.ToInt64(strAI.Text)

Next

'Display the total value in the txtAnnualInterestTotal textbox

AIT.Text = Convert.ToString(finalVal)

EndSub
code------------

Are you adding the textboxes dynamicaly? If so, you have to readd them on every postback.

I believe I am. Here is the code I am adding to the Page Init. Am I corrected adding them?

Sub createDynamicFields()

' Create the table and the controls based on the Term(# of years)

Dim IAsInteger

Dim intCounterAs Int64

If DS_Term.Text <> ""Then

For I = 0ToCInt(DS_Term.Text) - 1

Dim lblFiscalYearAs LiteralControl =New LiteralControl

Dim txtTextBoxAs TextBox =New TextBox

Dim txtTextBox2As TextBox =New TextBox

Dim txtTextBox3As TextBox =New TextBox

Dim tRow2As TableRow =New TableRow

Dim tCell1As TableCell =New TableCell

Dim tCell2As TableCell =New TableCell

Dim tCell3As TableCell =New TableCell

Dim tCell4As TableCell =New TableCell

' Grab Fiscal Year from tbBeginngingFiscalYear and Incurment the date by the DS_BondTerm field

lblFiscalYear.ID = "lblFiscalYear" & I + 1

lblFiscalYear.Text = Convert.ToString(Convert.ToInt64(DS_BeginningFiscalYear.Text) + I)

'**********************************

'Set the column width and

txtTextBox.Columns = 15

txtTextBox2.Columns = 15

txtTextBox3.Columns = 15

'Assign the textboxes IDs

txtTextBox.ID = "txtInterest" & I + 1

txtTextBox2.ID = "txtOsPrincipal" & I + 1

txtTextBox3.ID = "txtAnnualInterest" & I + 1

'Assign pre-defined values

'txtTextBox.Text = CStr(I + 1)

'txtTextBox2.Text = CStr(I + 1)

'txtTextBox3.Text = CStr(I + 1)

'Assign the cells to a row

tRow2.Cells.Add(tCell1)

tRow2.Cells.Add(tCell2)

tRow2.Cells.Add(tCell3)

tRow2.Cells.Add(tCell4)

'Assign the row to the table

myTable.Rows.Add(tRow2)

'Create the new controls

tCell1.Controls.Add(lblFiscalYear)

tCell2.Controls.Add(txtTextBox)

tCell3.Controls.Add(txtTextBox2)

tCell4.Controls.Add(txtTextBox3)

'Add the table to the placeholder

plhBondTerms.Controls.Add(myTable)

myTable.CellPadding = 0

myTable.CellSpacing = 0

'intCounter = intCounter + 1

'ViewState("Count") = intCounter

Next I

' ************************************

EndIf

EndSub


you should call this method on every postback

System.NullReferenceException: Object reference not set to an instance of an object.

Hello:

I have a component that returns a value from a Sql Count statement... unfortunately I get the following error: System.NullReferenceException: Object reference not set to an instance of an object.

My component code:

Function GetCount(varAccountNumber as String) as String
conSqlConnect = New SqlConnection( "..." )
conSqlConnect.Open()
cmdSelect = New SqlCommand( "SELECT Count([account number]) AS Total From some_table Where [account number]=@dotnet.itags.org.accountnumber", conSqlConnect )
cmdSelect.Parameters.Add( "@dotnet.itags.org.accountnumber", varAccountNumber )
Return (cmdselect.executescalar())
conSqlConnect.Close()
End Function

on my code-behind page. I have

If myComponent.GetCount(user.identity.name) = 0 Then
'do something
End If

any suggestions?Which line caused this error?
>>Which line caused this error?

If myComponent.GetCount(user.identity.name) = 0 Then

What is "myComponent" ? It seems that it is not set correctly. Make sure that you initialize it the way it needs to be.
Yes I did initialize mycomponent like so:

Dim MyComponent as MyComponentClass
myComponent = New MyComponentClass()

any suggestions?
Either the component or the user.identity.name is causing the error. Try to debug the GetCount function of your component and also check if user.identity.name contains any value. At last I would say that debugging is the only way. Try quickwatch in Visual Studio.
Hope that it helped at least a little bit.

system.object to namevalue collection

I'm reading some stuff in a custom section of the
web.config file into a name value collection. What do I
need to do to make this work:

Dim nvcConfig As NameValueCollection = _
ConfigurationSettings.GetConfig
("myApp/mySection ")

With option strict on?See:

http://msdn.microsoft.com/library/d...ionsections.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.

"Charles" <a@.b.c> wrote in message
news:0b3c01c36e2f$fca64820$a401280a@.phx.gbl...
> I'm reading some stuff in a custom section of the
> web.config file into a name value collection. What do I
> need to do to make this work:
> Dim nvcConfig As NameValueCollection = _
> ConfigurationSettings.GetConfig
> ("myApp/mySection ")
> With option strict on?

System.OverflowException during IPostBackDataHandler.LoadPostData

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
following (Me.Value = postCollection(Me.ID & "_currvalue")):

Public Function LoadPostData(ByVal postDataKey As String, ByVal
postCollection As NameValueCollection) As Boolean Implements
IPostBackDataHandler.LoadPostData
Me.Value = postCollection(Me.ID & "_currvalue")
Return True
End Function

I will admit that this is my first time using the IPostBackDataHandler
interface, but 'System.OverflowException' 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
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/What does the Value property and RaisePostDataChanged method (another method
of IPostBackDataHandler) 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" <njsokalski@.hotmail.comwrote in message
news:%23cRbMd8qGHA.1140@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted 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
following (Me.Value = postCollection(Me.ID & "_currvalue")):
>
>
Public Function LoadPostData(ByVal postDataKey As String, ByVal
postCollection As NameValueCollection) As Boolean Implements
IPostBackDataHandler.LoadPostData
Me.Value = postCollection(Me.ID & "_currvalue")
Return True
End Function
>
>
I will admit that this is my first time using the IPostBackDataHandler
interface, but 'System.OverflowException' 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
njsokalski@.hotmail.com
http://www.nathansokalski.com/
>


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(ViewState("value")) Then Return 0 Else Return
ViewState("value")
End Get
Set(ByVal value As Integer)
ViewState("value") = value
End Set
End Property

And here is the code for the RaisePostDataChangedEvent method:

Public Sub RaisePostDataChangedEvent() Implements
IPostBackDataHandler.RaisePostDataChangedEvent
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.ClientScript.RegisterClientScriptBlock 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 IPostBackDataHandler implementation and the
Me.pixeltovalue declaration and assignment that I showed above. Any ideas as
to what the problem might be? Thanks.
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"Teemu Keiski" <joteke@.aspalliance.comwrote in message
news:Oblpjg9qGHA.4516@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

What does the Value property and RaisePostDataChanged method (another
method of IPostBackDataHandler) 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" <njsokalski@.hotmail.comwrote in message
news:%23cRbMd8qGHA.1140@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted 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
>following (Me.Value = postCollection(Me.ID & "_currvalue")):
>>
>>
>Public Function LoadPostData(ByVal postDataKey As String, ByVal
>postCollection As NameValueCollection) As Boolean Implements
>IPostBackDataHandler.LoadPostData
> Me.Value = postCollection(Me.ID & "_currvalue")
> Return True
>End Function
>>
>>
>I will admit that this is my first time using the IPostBackDataHandler
>interface, but 'System.OverflowException' 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
>njsokalski@.hotmail.com
>http://www.nathansokalski.com/
>>


>
>


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" <njsokalski@.hotmail.comwrote in message
news:OWsfabErGHA.3856@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

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(ViewState("value")) Then Return 0 Else Return
ViewState("value")
End Get
Set(ByVal value As Integer)
ViewState("value") = value
End Set
End Property
>
>
And here is the code for the RaisePostDataChangedEvent method:
>
>
Public Sub RaisePostDataChangedEvent() Implements
IPostBackDataHandler.RaisePostDataChangedEvent
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.ClientScript.RegisterClientScriptBlock 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 IPostBackDataHandler implementation
and the Me.pixeltovalue declaration and assignment that I showed above.
Any ideas as to what the problem might be? Thanks.
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
>
"Teemu Keiski" <joteke@.aspalliance.comwrote in message
news:Oblpjg9qGHA.4516@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>What does the Value property and RaisePostDataChanged method (another
>method of IPostBackDataHandler) 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" <njsokalski@.hotmail.comwrote in message
>news:%23cRbMd8qGHA.1140@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted 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
>>following (Me.Value = postCollection(Me.ID & "_currvalue")):
>>>
>>>
>>Public Function LoadPostData(ByVal postDataKey As String, ByVal
>>postCollection As NameValueCollection) As Boolean Implements
>>IPostBackDataHandler.LoadPostData
>> Me.Value = postCollection(Me.ID & "_currvalue")
>> Return True
>>End Function
>>>
>>>
>>I will admit that this is my first time using the IPostBackDataHandler
>>interface, but 'System.OverflowException' 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
>>njsokalski@.hotmail.com
>>http://www.nathansokalski.com/
>>>


>>
>>


>
>


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
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"Teemu Keiski" <joteke@.aspalliance.comwrote in message
news:ObNfoyJrGHA.4504@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

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" <njsokalski@.hotmail.comwrote in message
news:OWsfabErGHA.3856@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>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(ViewState("value")) Then Return 0 Else Return
>ViewState("value")
> End Get
> Set(ByVal value As Integer)
> ViewState("value") = value
> End Set
>End Property
>>
>>
>And here is the code for the RaisePostDataChangedEvent method:
>>
>>
>Public Sub RaisePostDataChangedEvent() Implements
>IPostBackDataHandler.RaisePostDataChangedEvent
>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.ClientScript.RegisterClientScriptBlock 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 IPostBackDataHandler
>implementation and the Me.pixeltovalue declaration and assignment that I
>showed above. Any ideas as to what the problem might be? Thanks.
>--
>Nathan Sokalski
>njsokalski@.hotmail.com
>http://www.nathansokalski.com/
>>
>"Teemu Keiski" <joteke@.aspalliance.comwrote in message
>news:Oblpjg9qGHA.4516@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>>What does the Value property and RaisePostDataChanged method (another
>>method of IPostBackDataHandler) 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" <njsokalski@.hotmail.comwrote in message
>>news:%23cRbMd8qGHA.1140@.TK2MSFTNGP05.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.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
>>>following (Me.Value = postCollection(Me.ID & "_currvalue")):
>>>>
>>>>
>>>Public Function LoadPostData(ByVal postDataKey As String, ByVal
>>>postCollection As NameValueCollection) As Boolean Implements
>>>IPostBackDataHandler.LoadPostData
>>> Me.Value = postCollection(Me.ID & "_currvalue")
>>> Return True
>>>End Function
>>>>
>>>>
>>>I will admit that this is my first time using the IPostBackDataHandler
>>>interface, but 'System.OverflowException' 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
>>>njsokalski@.hotmail.com
>>>http://www.nathansokalski.com/
>>>>
>>>
>>>


>>
>>


>
>