|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Load and Update of data in Custom ControlI have a customer web control that displays data in the user prescribed
format on an aspx. I create it in Page_Load and add it to the page.Controls list in the correct place between the form tags. The data looks good. The user changes some data and clicks the Save button. The event gets sent to "Public Overrides Sub ProcessUserDirective(ByVal menu As String, ByVal cmd As String)" which is a method in the code. The Update method on the web control fires and updates the database. This is where things go wrong. Since the web control is created in page load it is already rendered before the update occurs which means that the data display is one cycle behind in accuracy. I am creating the controls in my Web Control in the CreateChildControls method. Without completely restructuring the control, where can I place the update so that it occurs before the reload of data? -- John Bankhead This article http://aspnet.4guysfromrolla.com/articles/092904-1.aspx by Scott
Mitchell should help you. Show quoteHide quote "John Bankhead" wrote: > I have a customer web control that displays data in the user prescribed > format on an aspx. I create it in Page_Load and add it to the page.Controls > list in the correct place between the form tags. The data looks good. The > user changes some data and clicks the Save button. The event gets sent to > "Public Overrides Sub ProcessUserDirective(ByVal menu As String, ByVal cmd As > String)" which is a method in the code. The Update method on the web control > fires and updates the database. > > This is where things go wrong. Since the web control is created in page > load it is already rendered before the update occurs which means that the > data display is one cycle behind in accuracy. I am creating the controls in > my Web Control in the CreateChildControls method. > > Without completely restructuring the control, where can I place the update > so that it occurs before the reload of data? > -- > John Bankhead
Custom Controls & Javascript
DataGrid with edititemtemplate What happened to Alignment property? RadioButton in 2 GroupNames? Another basic question: How to call and show one Web Form from another Web Form? ASP.net datagrid with more than 1 datasource Datagrid - How to format EditCommandColumn? SortCommand and custom headers - why won't they play nice? Odd Dropdownlist problem ListBox not firing SelectedIndexChanged (AutoPostBack=True) |
|||||||||||||||||||||||