How to Avoid Page Refresh After Button Click Event in Asp.Net

Disable page refresh after button click ASP.NET

I would place the control inside of an Update panel.
To do so, you would also need a script manager above it, so something like this:

 <asp:ScriptManager runat="server" ID="sm">
</asp:ScriptManager>
<asp:updatepanel runat="server">
<ContentTemplate>
<asp:button id="button1" runat="server" Text="clickme" onclick="function" />
</ContentTemplate>
</asp:updatepanel>

if a control inside the update panel does a postback, it will only reload the part of the page inside of the upate panel.Here is a link you may find useful from the MSDN site.

stop reload page in asp.net after button click

This is server side button. ON click of this if you have anything processing on server side than page will post back. Use Ajax if you don't want page post back.

you can use Use Update Panel or Callback too.

How to avoid page refresh after button click event in asp.net/vb.net

thank you for your answers !

I managed to make it work thanks to the <asp:updatepanel> element which allows not to refresh the page

ASP.net page refresh after click button

Try this statement.

 Response.Redirect(Request.RawUrl);


Related Topics



Leave a reply



Submit