locked
update control RRS feed

  • Question

  • User-1614001388 posted

    In my application, I have 3 pages from which users can update a user control(ascx). When ever user updates a field in one of the pages, the user control's associated value needs to be updated. Also, if the user moves to next page and updates values in that page, the corresponding values in the usercontrol needs to be updated too.

     Please let me know how to acheive this.

    Friday, March 28, 2008 10:50 AM

Answers

  • User-1136466523 posted

    Hi,

    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>

    From your description, you want your user control’s property be edited from several pages, here, I need make some clarification on it, do you mean you want your user control be updated from different users, different clientside?

    <o:p> </o:p>

    If so, I think this is something which cannot be achieved. You must know every user control is not something like database which can maintain the data from different client. You must know when the ASP.NET application runs, each user would be assigned with a HttpApplication object. And the HttpApplicaiton instance processes only one request at a time. So the user control is created as an individual instance for every users, but is not shared among all the users. So let’s back to your problem, you mentioned you want the user control which user B uses be updated as soon as the User A edited the user control. It doesn’t make sense.

    <o:p> </o:p>

    You should refer the following article which may be helpful to understand the ASP.NET page working mechamism.

    http://msdn.microsoft.com/en-us/library/ms178473.aspx

    <o:p> </o:p>

    If I’ve misunderstood your problem, please feel free to reply.

    <o:p> </o:p>

    Thanks.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 30, 2008 10:11 PM

All replies

  • User653304408 posted

    Hi! You can use the ASP NET Session

    When there is a change on fields you store them on the session so then you can access them on other pages

    Session["Field1"] txtFromPage1.Text;

    ------

    if (Session["Field1"] != null) 

         txtFromPage2.Text = (string)Session["Field1"] ;

    Friday, March 28, 2008 11:11 AM
  • User-1614001388 posted

    I need to update the user control on the page when ever an update to one of the server controls was made. If the user goes to next page, that page will also have the same user control and the values of the usercontrol in previous page should reflect  in the current page. How can this be done without using sessions.

    Friday, March 28, 2008 11:30 AM
  • User1690675763 posted

     One solution is before updating the value check from the database that value is updated from other page or not.

    Sunday, March 30, 2008 9:43 AM
  • User-1136466523 posted

    Hi,

    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>

    From your description, you want your user control’s property be edited from several pages, here, I need make some clarification on it, do you mean you want your user control be updated from different users, different clientside?

    <o:p> </o:p>

    If so, I think this is something which cannot be achieved. You must know every user control is not something like database which can maintain the data from different client. You must know when the ASP.NET application runs, each user would be assigned with a HttpApplication object. And the HttpApplicaiton instance processes only one request at a time. So the user control is created as an individual instance for every users, but is not shared among all the users. So let’s back to your problem, you mentioned you want the user control which user B uses be updated as soon as the User A edited the user control. It doesn’t make sense.

    <o:p> </o:p>

    You should refer the following article which may be helpful to understand the ASP.NET page working mechamism.

    http://msdn.microsoft.com/en-us/library/ms178473.aspx

    <o:p> </o:p>

    If I’ve misunderstood your problem, please feel free to reply.

    <o:p> </o:p>

    Thanks.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 30, 2008 10:11 PM
  • User-1614001388 posted

    Here's my scenario.There is a usercontrol, which is used on two pages Page1 and Page 2. If user A updates a usercontrol value in Page 1 and moves to Page2 from Page 1, the user control in Page 2 should reflect the change.

     

    Tuesday, April 1, 2008 4:28 PM
  • User1690675763 posted

     Its simple scenario. there should be no problem with it. when you are updating valus from page1 it's saved into database. and when you are moving to page 2 the user control there is binding to database and it will automatically  get latest value from table.........is not it..........

    if you have some different scenario, explain in details.

     

    Muhammad Rizwan Javed,


     

    Wednesday, April 2, 2008 3:52 AM