Prevent post-back while allowing client-side events to happen

3 posts, 1 answers
  1. Alexander
    Alexander avatar
    20 posts
    Member since:
    Jun 2008

    Posted 25 Jun 2008 Link to this post

    We're trying to use a RadTabStrip for navigation, where root tabs are categories, and their sub-tabs are locations. To handle the navigation, I've set up a OnTabClick server-side event, which works fine, except that it doesn't discriminate between the category (root) tabs and the location (sub) tabs, so I got a post-back for both, which was undesirable. To try and compensate for this, I set up a client-side event handler, OnClientTabSelecting, where I call "eventArgs.set_cancel(true);" if the selected tab is a root tab. This prevents the post-back, but it also stops them from being selected altogether, so now I'm stuck on the first category tab, because clicking any of the others results in nothing happening.

    Do you have any suggestions for how to solve my problem? That is, client-side tab selection for root tabs, and server-side tab click event for sub tabs.
  2. Answer
    Paul
    Admin
    Paul avatar
    4281 posts

    Posted 25 Jun 2008 Link to this post

    Hello Alexander,

    You can easily achieve your goal by setting the PostBack property of the root tabs to false. In that way only the child items will postback.

    Sincerely yours,
    Paul
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Alexander
    Alexander avatar
    20 posts
    Member since:
    Jun 2008

    Posted 25 Jun 2008 Link to this post

    I can't believe I didn't see that property. Thank you for your swift and helpful answer. :-)
Back to Top