Try Now
More in this section

Forums / Developing with Sitefinity / how to maintain current div on postback

how to maintain current div on postback

2 posts, 0 answered
  1. Sony
    Sony avatar
    7 posts
    21 Aug 2010
    30 Aug 2010
    Link to this post

    I have a usercontrol. In that, I have 4 divs. When page load, I am displaying the first div and on the click of the Next button in the first div, I am making first div display=none and displaying the second div. Like that, when i click on the next button inside div3, i make div4 visible and all other divs dispaly=none.

    In div4, I have upload button and submit button(both are asp:imagebutton). When i click on the upload button, selected files should save into a folder. after that on click on the submit button,i need to save all the values in the controls (previous div also) to be save in the database.

    But my problem is when i click on the upload button, nothing is happening, only page postback and displaying the first div (like first pageload). I need to do all upload functionalities on the click event and show the same div(div4) otherwise I cannot click on the submit button.

    Please help me to do this.

    Thanks & Regards
  2. Georgi
    Georgi avatar
    3583 posts
    10 Oct 2016
    02 Sep 2010
    Link to this post
    Hello Sony,

    In order to this, you need to accomplish several things:

    1. You may save the current step (or div) in a hidden field with attribute runat="server".
    2. Each div's content should be placed in server controls. 
    3. Upon a postback, you should first check if the step (in the hidden field) is div4 (last step). If it is, you should process the information - you will have access to it since it is placed in server controls. Finally, you may show a message that the information is saved. 

    I hope this makes sense. 

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered