Showing posts with label refresh. Show all posts
Showing posts with label refresh. Show all posts

Monday, March 26, 2012

Instant GridView Refresh on Update Button Click

I have an application that allows for the updating of data in an Oracle table. I am using Atlas, with ObjectDataSources.

There is a quicklist gridview displaying the data, the user picks the record and it displays some options for updating the record in a seperate form on the page.

Upon clicking the update button the record is updated and a Verify changes button is displayed. When the user clicks the Verify changes button the page will display the correct update.

I have found no other way to to display the change on the Update button click.

Is there a way to instantly show the update with only one click of a button. I want the gridview to rebind and display the new update with the update button click. Why does it take two clicks to show the update?

are you using Gridview1.Databind() when you click update?

That forces an update no matter what.

Saturday, March 24, 2012

Invalid viewstate

I'm having no fun trying to figure out why I keep getting an invalid viewstate when I do a page refresh for this code:
<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false" Title="Test"%><script runat="server"> Protected Sub Test_OnCommand(ByVal sender As Object, ByVal Args As CommandEventArgs) Test.Visible = False End Sub </script><form runat="server" id="hello"><asp:ScriptManager id="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel id="UpdatePanel1" runat="server" updatemode="Conditional" visible="true"> <ContentTemplate> <asp:Button id="Test" text="Generate" runat="server" enableviewstate="true" width="100" oncommand="Test_OnCommand"></asp:Button> </ContentTemplate> </asp:UpdatePanel></form>
Your help would be greatly appreciated :-)

The code runs just fine on my PC.


The code works fine on my computer. Have you updated your version of Visual Studio with Service Pack 1. It was suppose to provide better support for Ajax. Maybe thats the problem, i can't be sure.