Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to display datas in a gridview from database while button is clicked,Note:With out page load

What I have tried:

<pre><pre>  <div>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
                    <Columns>
                        <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" />
                         <asp:BoundField DataField="Name" HeaderText="NAME"  />
                        <asp:BoundField DataField="Address" HeaderText="ADDRESS"  />
                    </Columns>
                </asp:GridView>
    
    <asp:Label ID="Label1" runat="server" Text="Click the Button To Bind the Data's in a Gridview"></asp:Label><br />
    <br />
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click"></asp:Button>
    </div>
Posted
Updated 12-Mar-17 21:46pm
Comments
Karthik_Mahalingam 13-Mar-17 3:44am    
you mean refreshing?
GrpSMK 13-Mar-17 3:55am    
yea while refreshing wont bind,bind only after button clicked
Karthik_Mahalingam 14-Mar-17 1:54am    
Always use  Reply  button, to post Comments/query to the user, so that the user gets notified and responds to your text.
GrpSMK 13-Mar-17 5:07am    
hi there?

1 solution

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900