R
RipperT
Don't know if this group covers web apps, but here goes. In VS 2005, I am
trying to get variables to hold thier values during postback from the
server. I convert a text box's user-keyed value to an integer and assign it
to a module level variable, then convert the variable and assign it to a
hidden text box, setting it's EnableViewState to true so it returns with the
reload. Then in the form's load event, I attempt to convert the contents of
the hidden textbox back to an integer thus:
intTotalCredits = Integer.Parse(Me.txtAccumCredits.Text)
and assign it back to the variable and I get a format exception:
"Input String was not in correct format."
I've also tried this with a label.Text and the HiddenField.Value; same
exception. I noticed that the line of code works fine in a sub, but not in
the load event. What gives?
Many thanx,
Ripper
PS: I'm following instructions in a VB textbook. I'm astounded there isn't
an easier way to do this. I understand there used to be a module available
that was unassociated with the web page, what happened to that?
trying to get variables to hold thier values during postback from the
server. I convert a text box's user-keyed value to an integer and assign it
to a module level variable, then convert the variable and assign it to a
hidden text box, setting it's EnableViewState to true so it returns with the
reload. Then in the form's load event, I attempt to convert the contents of
the hidden textbox back to an integer thus:
intTotalCredits = Integer.Parse(Me.txtAccumCredits.Text)
and assign it back to the variable and I get a format exception:
"Input String was not in correct format."
I've also tried this with a label.Text and the HiddenField.Value; same
exception. I noticed that the line of code works fine in a sub, but not in
the load event. What gives?
Many thanx,
Ripper
PS: I'm following instructions in a VB textbook. I'm astounded there isn't
an easier way to do this. I understand there used to be a module available
that was unassociated with the web page, what happened to that?