Showing posts with label viewstate. Show all posts
Showing posts with label viewstate. Show all posts

Monday, March 26, 2012

Integration with ViewState

Sometimes, I store information in the viewstate statebag. Since this information goes back to the server on a roundtrip, I have access to the information. If I want to send that same information back to the server, how should I handle the situation where the information is stored in the statebag? Should I go back and use hidden fields that javascript can get at? is there some type of way to reach into the statebag from the client-side javascript? I realize that the statebag is not considered to be secure so would it be possible to include some type of javascript decoder in atlas to get at values in the statebag?
WallyHi Wally,
I didn't see any viewstate support at the moment, and I think Microsoft is thinking of AJAX methods as I. If you try the Atlas web controls you will see that there is no Click event for the server.

I don't think we'll be creating solutions to change view state from the client. Often times this is not possible - view state may be encrypted. More often though, its simply not efficient to try and parse that content using script.

However, server controls that preserve the server-based programming model, while providing richer experience will use view state creatively, to provide the right behavior if an ajax-style page does need to postback for some reason.

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.