How to load dynamic content when a tab is clicked without re-loading the page using Ajax?

3 posts, 0 answers
  1. Ritika Gupta
    Ritika Gupta avatar
    12 posts
    Member since:
    Jan 2010

    Posted 21 Jan 2010 Link to this post

    How can I load dynamic content when a tab is clicked without re-loading the page using Ajax where the tab postback will load the content in div or panel? Help with instructions on how to go about this is deeply appreciated.

    Many Thanks,
    Ritika

  2. Mark Galbreath
    Mark Galbreath avatar
    171 posts
    Member since:
    Jul 2009

    Posted 21 Jan 2010 Link to this post

    I use jQuery for dynamically loading content (lazy loading) when a tab is clicked:
    <telerik:RadScriptBlock runat="server">  
        <script type="text/javascript">  
            $(function() { $('#overview').load( 'overview.html'); });  
        </script> 
    </telerik:RadScriptBlock>  
    where '#overview' is jQuery's way of locating document elements and represents a <div> node in my aspx page:
    <div id="overview"></div> 
    When the tab is clicked, the contents of the file overview.html is loaded into the <div> node.  I put the jQuery script anywhere in the RadPageView of the tab in which I want the content.

    Note that your injected content cannot have any <html>,<head>, or <body> tags, which makes sense if you think about it.

    The only thing you need to make this work is download jQuery 1.4 from www.jQuery.org, stick jquery-1.4.js anywhere you want (I put it in a js directory below the root; some people recommend getting the link to google's jQuery server, but I've found network lag will cause Javascript errors on page load) and declare it in your page (or better, master page) header:
    <head> 
        <script type="text/javascript" src="/js/jquery-1.4.js"></script>
    </head>

    For an argument for using google, see
    http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/ 


    Cheers!
    Mark
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nguyen The
    Nguyen The avatar
    1 posts
    Member since:
    Aug 2010

    Posted 05 Aug 2010 Link to this post

    hi all!
    I've same your problem, i can not fix it now.
    here is my website: http://thoathiem.net/
    I've a "fire flash", when click on my menu, the page reloaded and "fire flash" re-play
    Can anyone help me fix it? Thanks so much !
Back to Top