|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to get changed text from web control textboxI 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 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 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
Inheriting from the TreeNode class
XHTML 1.1 and DIV 1 pixel in height GridView "visible=False" data items not accessible? programattically Menu Control and Page Validation Dependent GridViews And CommandArguments Set visibility of label in itemtemplate of repeater control VS 2005 Validator controls Adding errors by hand to a validationsummary? Dropdownlist causes blank screen strange question about DropDownList |
|||||||||||||||||||||||