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
How to Get All the Possible 3 Letter Permutations
Why Can't I Reference System.Componentmodel.Dataannotations
How to Detect Iis Version Using C#
Instantiate a Class from Its Textual Name
How to Hook into Hardware Keyboard Events at an Application Level
Memorystream - Cannot Access a Closed Stream
Deploy a C# Stateful Service Fabric Application from Visual Studio to Linux
Asp .Net Button - Onclientclick="Return Function()" Vs Onclientclick="Function()"
In C# Wpf, Why Is My Tabcontrol's Selectionchanged Event Firing Too Often
Default Value for Missing Properties with JSON.Net
Directory.Getcurrentdirectory() Not Working on Linux
How Can Synchronizationcontext.Current of the Main Thread Become Null in a Windows Forms Application
With C# Use Chrome to Covert HTML to Pdf