Click here to Skip to main content
15,887,376 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a two asp.net pages, one is customerEntry.aspx, from which client enters the value and second one customerEntryView.aspx, in which data is displayed in gridview..

When I make the new entry in the form, the data should be updated in gridview how to make the gridview autorefresh..?

My problem is - only when I refresh the page, then gridview data gets refreshed, oherwise not.

Now I want to autorefresh the grid, whenever new entry made withuot refreshing the page.
Posted
v3

Please check the below links for your requirements.
1. How to refresh an ASP.NET GridView automatically[^]
2. Auto refresh data in ASP.Net page[^]
 
Share this answer
 
Are you connecting CustomerEntry.aspx and CustomerEntryView.aspx through any redirections? I mean to say how do you navigate between both the pages?
If client is entering some data into CustomerEntry.aspx, on Save/Submit button click redirect to CustomerEntryView.aspx. On Page_Load event of the page load the grid.
 
Share this answer
 
after you make entry or update in the database,
place your code to refresh the grid.
C#
gridview1.DataBind();
 
Share this answer
 
Try doing some Ajax call. Timer and Put the grid in an Update Panel where you will be using a Trigger that triggers whenever the Timer Ticks.. and when the Timer Ticks there you will rebind the Grid with your data
 
Share this answer
 
You should use Timer. Start the timer with timer1.Start(). Clear the GridView, set GridView1.DataSet = null and reload the Bindings.
Refer How to refresh GridView automatically using AJAX Timer[^]

--Amit
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900