Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh GridView

Status
Not open for further replies.

hamking01

Programmer
May 30, 2004
238
US
I have an asp:table in a webpartzone that contains a textbox and button and an asp:gridview in another webpartzone. When the user inputs data in the textbox and clicks the button, it inserts into an sql table. The gridview displays data in the sql table. The gridview is using an sqldatasource.

I've added gridview.databind() to the buttons click event to refresh the gridview in the webpartzone once data is inserted. This works fine in debug mode, but once I publish the site the gridview will not refresh. If I reopen the browser the data is displayed in the gridview so I know the data is getting inserted. It just won't refresh.

Any ideas why this works in debug mode but not live. Thanks
 
hamking01: Just a thought - make sure you're not restricted to the Not.IsPostBack event during the binding - that seems to to happen a lot in these situations (i.e., it appears to be binding on Page_Load but not on Postback). I'd probably turn EnableViewState="Off" on the DataGrid as well. Strikes me as something straight forward. Good to see you around again Hamking -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top