RE: Adding Controls to a Page 2005-02-23 - By Boudreau, Duane
I added code to enable view state enabled - no difference. Would it help if I posted the entire aspx and cs files?
Duane
-----Original Message----- From: John Brathwaite [mailto:team@(protected)] Sent: Tuesday, February 22, 2005 6:01 PM To: aspnet-controlbuilding@(protected) Subject: [aspnet-controlbuilding] RE: Adding Controls to a Page
Duane, do you have EnableViewState=true for your asp:textbox and other controls?
Cheers John
-----Original Message----- From: Boudreau, Duane [mailto:BoudreauD@(protected)] Sent: Wednesday, 23 February 2005 11:11 a.m. To: aspnet-controlbuilding@(protected) Subject: [aspnet-controlbuilding] RE: Adding Controls to a Page
That's the thing - I'm not setting any values.
I am using checkboxes, which are not maintaining state and text boxes which are not saving data that is entered.
Duane
-----Original Message----- From: Thomas Johansen [mailto:aylar@(protected)] Sent: Tuesday, February 22, 2005 4:53 PM To: aspnet-controlbuilding@(protected) Subject: [aspnet-controlbuilding] RE: Adding Controls to a Page
Only set the e.g. the Text property on the initial load, NOT on the postback;
if (!IsPostBack) { someControl.Text = "Some Text"; }
- Thomas
-----Original Message----- From: Boudreau, Duane [mailto:BoudreauD@(protected)] Sent: Tuesday, February 22, 2005 10:25 PM To: aspnet-controlbuilding@(protected) Subject: [aspnet-controlbuilding] RE: Adding Controls to a Page
I added the code to create the controls dynamically to the Page_Load() method post back, and in the OnInit() method, but in both cases the data is not being preserved.
What am I doing wrong?
Duane
-----Original Message----- From: Joe Bradvica [mailto:JoeB@(protected)] Sent: Tuesday, February 22, 2005 3:10 PM To: aspnet-controlbuilding@(protected) Subject: [aspnet-controlbuilding] RE: Adding Controls to a Page
You have to re-add the controls on postback. The data is then repopulated to the controls and you can access the data.
Joe B.
Need SQL Advice? http://sqladvice.com Need RegEx Advice? http://regexadvice.com Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com Need RegEx Advice? http://regexadvice.com Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com Need RegEx Advice? http://regexadvice.com Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com Need RegEx Advice? http://regexadvice.com Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com Need RegEx Advice? http://regexadvice.com Need XML Advice? http://xmladvice.com
|
|