RadAjax? not allowing JScript to Access current value of ViewState Server Variable

2 posts, 0 answers
  1. Neal
    Neal avatar
    114 posts
    Member since:
    Apr 2008

    Posted 16 Aug 2010 Link to this post

    Hi All,

    I need to access the current value of a Server Side variable (stored as a ViewState var) from a Java Script.
    easy enough...eg



    var i == <%= OGridItem_ItemIndex %>

    but, If I set the value in Server code, and on Client Side try to Access it, I get it's previous (initial value) , not it's new current value??
     I have RadAjax Manager and grid on page and all ajaxified ControlId's and UpdatedControls in it. And that Server set Viewstate Var is not nor seems to be able to be.
    Script and Grid are wrapped in RadCodeBlocks.

    If I try it a few times, it always returns the Previous not current value.
    The current Value is set in C#  after a straightforward    __DoPOstback(Arg_Source, EventArgs). The rest of the Controls on the page are set for Ajax postbacks as per the RadAjaxManager.

    How do I retrieve the current value of this ViewState Var when in JS??



  2. Veli
    Veli avatar
    2002 posts

    Posted 19 Aug 2010 Link to this post

    Hello Neal,

    Can you post some sample code? Public server variables should be accessible from inline code expressions in the markup (<%= %>) OK. Inline code expressions (<% %> and <%= %>) are evaluated at render time, so you should have your ViewState value updated by the time you access it.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top