Home All Groups Group Topic Archive Search About

how to get changed text from web control textbox

Author
17 Jan 2006 7:19 PM
Eric W. Holzapfel
Hello Visual Studio Group,

I have created a webform with controls.  My idea is to load the text
values from these controls as values for an insert stored procedure.
The insert works.  I have one control that I preload (on the page_load
event) with "today's date",  this can be considered the default value.
I want the user to be able to change the date.  My problem is, I enter a
new date (like the day before, etc, 1/16/2006 instead of 1/17/2006) and
the new date (1/16/2006) does not show as the text value for the textbox
control, the control keeps the value I load in at the Page_load method.
  I am missing how I get the control to "update" to the value I type in.
  the control is not connected to a dataset or table, etc.  I want to
use controls to provide text and number data for my insert sql procedure.

What am I missing here???

thanks,

eric

Author
20 Jan 2006 6:21 AM
Nathan Sokalski
The Page_Load procedure is called every time the page is loaded. Therefore,
the code you are placing in it is getting run each time you submit the form.
Try placing the code inside a conditional that tests whether it is a
PostBack, such as the following:

If Not IsPostBack Then

'Your Code Here

End If


--
Nathan Sokalski
njsokal***@hotmail.com
http://www.nathansokalski.com/
Show quoteHide quote
"Eric W. Holzapfel" <e.m***@verizon.net> wrote in message
news:11sqh05l7mvdg80@corp.supernews.com...
> Hello Visual Studio Group,
>
> I have created a webform with controls.  My idea is to load the text
> values from these controls as values for an insert stored procedure.
> The insert works.  I have one control that I preload (on the page_load
> event) with "today's date",  this can be considered the default value.
> I want the user to be able to change the date.  My problem is, I enter a
> new date (like the day before, etc, 1/16/2006 instead of 1/17/2006) and
> the new date (1/16/2006) does not show as the text value for the textbox
> control, the control keeps the value I load in at the Page_load method. I
> am missing how I get the control to "update" to the value I type in. the
> control is not connected to a dataset or table, etc.  I want to use
> controls to provide text and number data for my insert sql procedure.
>
> What am I missing here???
>
> thanks,
>
> eric