ASP Tabpanel submission in only one tab

I have a tab with a calendar control in the 4th tab, but when I select a date, the postback causes the tab to go back to the first tab, not the fourth it came from. Is there a way to make it go back to the tab that has the calendar control enabled and not go back to the first tab?

I know setting autoPostback to true in the TabContainer will do this, but that means it reloads whenever the tabs are changed, not just what I want.

Any ideas?

0


source to share


2 answers


Wrapping the content of the fourth tab in the UpdatePanel control should do the trick.



<ajaxToolkit:TabPanel runat="server" ID="tabCS" HeaderText="Country Settings">
  <ContentTemplate>
    <asp:UpdatePanel runat="server" ID="upCountry" UpdateMode="Conditional">
      <ContentTemplate>

          ... content and calendar

       </ContentTemplate>
    </asp:UpdatePanel>
  </ContentTemplate>
</ajaxToolkit:TabPanel>

      

0


source


Here is the best practice I've found.

If the other tabs in the tab bar do not need to be updated, set the content of each panel to the update bar. If you need to update other panels, you can call the method programmatically to update them.

There are two good reasons for this: 1.) By putting refresh panels on tabs, you will have fewer bits to get back from the server. 2.) Calling update methods programmatically gives you more information about what you are providing to the end user and you won't forget to update the data.

Remember if you are using multiple panels to change the refresh mode from always to conditional to update only the relevant information on the client.



Also, if you want to put the entire tab control bar item in the refresh bar, you may need to add any formatting that will be done to the CSS file, as my experience is that it was not able to keep the default formatting with its refresh.

If you need more information or sample code, just let me know.

Andrew

0


source







All Articles