[1.0 Preview] DirectEvents do not always retain viewstate

  1. #1

    [1.0 Preview] DirectEvents do not always retain viewstate

    Unfortunately I can't provide a sample that demonstrates this behavior because the code is very large at this point and spans multiple files. However, what I can say is that in two separate code pages with a direct event, the server-side code has no viewstate and the control values are not available in the DirectEvent postbacks.

    In one scenario, I have no problem. I have a page with a user control ascx that is in the aspx of a page and direct event gets called and the serverside control's .Text values are accessible. However, in another case, they are always null. Both are wrapped in formpanel controls

    Are there any general guidelines anyone can provide to help debug why viewstate would not be available that I can try?

    I have to work around this problem with a DirectMethod but I still do not understand why. Is it possible there have been bug-fixes in the SVN that are not present in the preview that may address issues related to something like this?
  2. #2
    Just passing by... Had this happen to me before. I believe it's either your

    EnableViewState="true"
    in your page or web.config file or

    AjaxViewStateEnabled="true"
    in your ext:ResourceManager
  3. #3

    Settings

    Yeah, I spent all day with these settings only to find out it did not remedy. I've matched both pages code as closely as I could and still, one works; the other doesn't regardless of these settings. It's quite strange.
  4. #4

    Figured it out

    Today, I came upon the solution. I was going over more closely the differences between the two pages. I noticed in one I had the Microsoft ScriptManager control loaded and the failing one did not, so I inserted the ScriptManager. It wasn't the ScriptManager that was causing the problem, but by adding it, a page compilation warning came up that exposed the issue. The issue was that I did not have a <form runat="server"> on the broken page. I removed the ScriptManager, put in the form, and things worked.

    I hope this follow-up helps someone else down the road because ext.net doesn't warn that it requires a top-level form, but if you value-access during ajax postback, it must be present.
  5. #5
    Quote Originally Posted by michaeld@vipmail.com View Post
    I hope this follow-up helps someone else down the road because ext.net doesn't warn that it requires a top-level form, but if you value-access during ajax postback, it must be present.
    The <form runat="server"> is not required in the latest v1.0 SVN build. Although would need a test case to confirm for your scenario.

    Hope this helps.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Not value retain when page navigate
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 10, 2011, 4:27 AM
  2. Retain TreePanel Scroll
    By hardik in forum 1.x Help
    Replies: 2
    Last Post: May 04, 2011, 4:11 AM
  3. Retain TreePanel scroll
    By hardik in forum 1.x Help
    Replies: 0
    Last Post: Apr 25, 2011, 11:12 AM
  4. Store does not retain value after post back
    By pooja in forum 1.x Help
    Replies: 1
    Last Post: Oct 15, 2010, 6:14 PM
  5. [CLOSED] PagingToolbar: Add option to retain last params
    By Mark.Cooke in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 03, 2010, 6:18 PM

Posting Permissions