asp.net refresh page without reloading code example
Example 1: razor can't refresh pages without restarting project
services.AddMvc().AddRazorOptions(options => options.AllowRecompilingViewsOnFileChange = true);
Example 2: page refresh on button click in c#
Response.Redirect(Request.RawUrl);