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.

Sam HobbsPosted Jan 2, 2019, 2:20 AM
I finally found something in Stackoverflow that worked. The problem was solved just by adding "Response.Redirect(Request.RawUrl);" at the bottom of the button click event.
Thank you Salman but the database is in the server so I need to execute something in the server to add the data to the database.
And thank you Laxmidhar. I tried an UpdatePanel and it did not help but maybe I wrote the UpdatePanel improperly.
Sreekanth, I also said that the addition of the record is working, so that part does not need to be changed..
Laxmidhar SahooPosted Jan 2, 2019, 12:07 AM
Sreekanth ReddyPosted Jan 1, 2019, 11:39 PM
Salman BegPosted Jan 1, 2019, 9:33 PM