|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Get value from textbox in webcontrolHi there,
Here is the problem I have 2 textboxes, one normal and the other in a webusercontrol and both have '1' set as text. If I change the text to '2' and press save, the normal textbox saves 2 while the textbox in the usercontrol saves 1. Thus the value of the textboxes after postback is normal textbox: 2 textbox in webcontrol: 1 why? Hi Kevin
You need to check that whatever code you have written to save the contents of the textbox in the webusercontrol is actually being executed on postback. If the postback event is triggered by a control on the normal page (e.g. a button or return key) then you will need to capture the event using the webusercontrol's page load event in conjunction with testing the IsPostBack boolean flag. No other event handlers will be executed in the webusercontrol if it was triggered by a control on the normal page. Another thing to check is the viewsetting for the textbox control. If set to false then content will not be preserved. Hope that helps Phil Hall
Menu Control Questions
CustomValidator points to wrong control GridView multiple DDL "Failed to load viewstate" when clicking button Javascript from treeview Gridview update does not work Paging in DataGrid does not work 2.. FileUpload Control in ASP 2.0. Re: Binding a single object to a control Disappearing asp:TreeView in a custom web control |
|||||||||||||||||||||||