Click here to Skip to main content
15,887,356 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a grid view with text boxes and button.When i click button a new row is added successfully and as well as full post back occurs.I want to stop full post back and as well as do other jobs during post back.
Posted
Comments
oliver grace 8-May-14 3:25am    
you can use update panel in your design part(.aspx page) to avoid post back.
[no name] 8-May-14 7:47am    
http://forums.asp.net/t/1652213.aspx?Link+button+in+gridview+causing+full+postback

Hi Sandip,

You can use Update Panel[^].

You can use following code:
ASP.NET
<asp:TemplateField>
     <FooterTemplate>
          <asp:UpdatePanel ID="upnlBtnAdd" runat="server">
                    <asp:LinkButton ClientIDMode="static" runat="server" ID="btnAdd" Text="Add" OnClick="btnAdd_Click"></asp:LinkButton>
          </asp:UpdatePanel>
     </FooterTemplate>
</asp:TemplateField>
 
Share this answer
 
v2
Comments
Sandip Paul 491984 8-May-14 3:16am    
Button inside the footer template of gridview.So how can i use update panel
Sandip Paul 491984 8-May-14 3:47am    
i tried this it gives me a error Error
'System.Web.UI.UpdatePanel' does not have a public property named 'LinkButton'.
Sanket Saxena 8-May-14 8:51am    
Because u forgot to add ContentTemplate inside update panel.
Neha Mukesh 9-May-14 6:54am    
use ContentTemplate inside update panel
set the Ispostback property to False
 
Share this answer
 

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