Click here to Skip to main content
12,818,489 members (34,591 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP ASP.NET WebForms event , +
I have a stored procedure. I wants to develop a very simple page in which, there will be only button called "Show Data". I want to bind my stored procedure to this button and after clicking this button the page should show gridview data.

And if possible I want to implement another button named "Hide Data" which will hide same gridview after clicking it.
Posted 26-Feb-12 23:50pm
Updated 26-Feb-12 23:54pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Within Page Load event


within btnShowData event

   bind gridview here.... 

within btnHide event

vikram_shinde 27-Feb-12 5:32am
it's working now..... many thanks for helping novice like me :)
vikram_shinde 27-Feb-12 7:21am
I want to take this application bit further.... When user click on "Show Data" button instead of showing gridview control on same page, the new page window should popup. SO I will get rid of "Hide Data" button... Is it possible to add this functionality.......
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

There is a simple logic for this.

Place two buttons one above the other.
The Above button text is "Show Data"
On the click event of this button, fire the Stored procedure.
Make the Grid visible with the data from stored procedure.
Make the "Show Data" Button Visible false and "Hide Data" Visible true.
On the click of the "Hide Data", Make the Grid Visible false And also the "Hide Data" Button Visible false.
Make the "Show Data" Button True.

Hope you will get the idea

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 27 Feb 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100