How to load gridview in page without postback

Posted on 2011-10-28
Last Modified: 2012-05-12
I have a page with many panels that have divs and quite a few calls to the database.  This is what I need to do but don't know how to go about it.  On the click of a button I am using javascript to do some validation and then I need to populate a gridview in a hidden div with a call to the database and passing a querystring that is the sql.  All this without full postback as I don't want all the elements above the grid to clear.  I thought about xmlhttprequest and ajax and the updatepanel but I haven't seen a good enough example that could be modified to suit what I need.  My site has master and content with one usercontrol.   Can someone show me a working example or just send me some links of  good examples that load a grid in the same page as I already have.   Thanks.
Question by:thamilto0410
    LVL 83

    Expert Comment

    LVL 1

    Author Comment

    codecruiser:  I am really new to ajax.  I have looked at many samples but don't understand enough yet to modify any of them so I decided to use the updatepanel.  It works and the grid and div load and the rest of the page does not post back but a second after it loads the updatepanel disappears.  I have a trigger set with asynpostback and id as the button and I have the script manager in a usercontrol that sits in this page and I have partialpagerendering set to true.  I also have if not page.ispostback on the page load in codebehind but I am still doing something wrong.  Can you tell me how to troubleshoot this?

    Accepted Solution

    Question PAQ'd and stored in the solution database.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now