avoid running function in page load event of user control inside a page with in master page
-
Hi, hoping someone can give me hint to solve this. I have a multiview web control in a aspx page with in master page. each view with in multiview has ascx page. by default first index of the view is set to active. as the page needs to go though the standard page life cycle so it will run all page load events of ascx even though i sent the first view to be active view. in one of the ascx page with in the view has a repeater control and i am loading a data in page load event in that ascx and its being executed everytime even though this control is not with in active view. so in aspx active view index change i added a dataload function for this page so when this the control is in the activeview the data source get bind to the control. these all is working fine. my problem is how do i get the updated dataset from ascx to aspx so i could store it in session or something without adding any function in page load event of user control. please help
-
Hi, hoping someone can give me hint to solve this. I have a multiview web control in a aspx page with in master page. each view with in multiview has ascx page. by default first index of the view is set to active. as the page needs to go though the standard page life cycle so it will run all page load events of ascx even though i sent the first view to be active view. in one of the ascx page with in the view has a repeater control and i am loading a data in page load event in that ascx and its being executed everytime even though this control is not with in active view. so in aspx active view index change i added a dataload function for this page so when this the control is in the activeview the data source get bind to the control. these all is working fine. my problem is how do i get the updated dataset from ascx to aspx so i could store it in session or something without adding any function in page load event of user control. please help
In the ascx control you can have a public property that can return a
dataset
, if the databind is called already andnull
if it is not called. from the page you can directly use this property to get thedataset
out of the control. -
In the ascx control you can have a public property that can return a
dataset
, if the databind is called already andnull
if it is not called. from the page you can directly use this property to get thedataset
out of the control.but repeater control has drop down list, textbox and are editable and I need to get the value of them as well. how do I do that? here is a details of my issue ViewState is disabled through out the entire aspx page Page contains a multiview control which has views and views has user controls prev and next button clicking prev or next button saves current data (SET()) within user control and loads data(GET()) of next user control (if it has any) one of the user control in a view has editable repeater control. in page load of this control I am binding the repeater as Repeater.DataSource = List of object Repeater.Databind() The problem is, this page load is being called disregard the view being active or inactive. So I need to bind the repeater else where in the user control so in my GET() function in aspx (where I load the user control with repeater) I bind the repeater by declaring repeater object as property in ascx as Me.RepeaterAsProperty.DataSource = List of object Me.RepeaterAsProperty.DataBind() I removed databind codes from ascx. upto now it works all good. When I click next button when this user control is active, I need to save modified data with in this repeater. so in SET() function I run a loop to get Me.RepeaterAsProperty.Items which is empty. I dont know how to get this working.
-
but repeater control has drop down list, textbox and are editable and I need to get the value of them as well. how do I do that? here is a details of my issue ViewState is disabled through out the entire aspx page Page contains a multiview control which has views and views has user controls prev and next button clicking prev or next button saves current data (SET()) within user control and loads data(GET()) of next user control (if it has any) one of the user control in a view has editable repeater control. in page load of this control I am binding the repeater as Repeater.DataSource = List of object Repeater.Databind() The problem is, this page load is being called disregard the view being active or inactive. So I need to bind the repeater else where in the user control so in my GET() function in aspx (where I load the user control with repeater) I bind the repeater by declaring repeater object as property in ascx as Me.RepeaterAsProperty.DataSource = List of object Me.RepeaterAsProperty.DataBind() I removed databind codes from ascx. upto now it works all good. When I click next button when this user control is active, I need to save modified data with in this repeater. so in SET() function I run a loop to get Me.RepeaterAsProperty.Items which is empty. I dont know how to get this working.