Sam Hobbs

Sam Hobbs

  • 52
  • 29.3k
  • 2.1m

Stay on page when a button is clicked

Jan 1 2019 7:15 PM
I want my ASP.Net web page to stay in the same page after processing a button click. 
 
This question has been asked many times I assume so I don't need details, just some guidance.

I have an ASP.Net Web Application using Web Forms and Entity Framework Code First and using Model Binding. I have written a very simple sample application; I call it a MicroBlog. It uses a database table and the table has just two fields, a time and a comment. So for adding records I have just a comment box and a button. Everything works but when I add a record I get back a new page that does not show the new record. When I navigate back using the back button I see the GridView with the new record, so the update is happening but I just get a new page.
 
If anyone can tell me enough so that I can find the detials elsewhere of how to do it then that is all I need.

Answers (4)