Javascript not firing after Ajax callback

2 posts, 0 answers
  1. Massimiliano
    Massimiliano avatar
    185 posts
    Member since:
    Oct 2012

    Posted 16 Jan 2014 Link to this post

    I have a quite complex nested controls scenario so I wasn't sure to post here on in the RadGrid section anyway..
    The control chain is this:
    RadGrid (HierarchyLoadMode = "Conditional") > NestedViewTemplate > Panel > RadMultipage (RenderSelectedPageOnly = "false") > UserControl > FormView

    Inside the FormView I have some RadScriptBlock that provide functions or some page load initialization.
    Just to make an example (that I'm trying to use for debugging as well) let's say inside the ItemTemplate of the FormView I have

    <telerik:RadScriptBlock runat="server">
        <script type="text/javascript">

    While inside the EditItemTemplate of the FormView I don't have this script.
    I expand the RadGrid nested view of a row and initialize the FormView inside my User Control to FormViewMode = Edit.

    So the script inside ItemTemplate it's not fired and that's correct.

    Then upon postback (ajax since the RadGrid is Ajaxified with RadAjaxManager) I switch the FormView inside my User Control to FormViewMode = ReadOnly and the problem is that the javascript alert it's not called the same and this is not good.

    Same thing of course apply if I expand the RadGrid NestedViewTemplate with FormView inside in FormViewMode = ReadOnly (script works) then after ajax postback I switch to FormViewMode = Edit (no script there it's ok) then after another ajax postback switch back to FormViewMode = ReadOnly (script doesn't work anymore)

    I don't know where in the chain is the culprit if in Multipage rendering behaviour or in RadGrid or in ajax or it's not even tied to Telerik controls (in this case forgive me for the question and you can delete the topic).

    Any hint? This is driving me crazy.. :)
  2. Massimiliano
    Massimiliano avatar
    185 posts
    Member since:
    Oct 2012

    Posted 19 Jan 2014 Link to this post

    UPDATE (solved): 
    I don't know at wich point of the control tree was the problem and even if it was caused by an interaction between some of the controls but removing the FormView inside my user control (and binding manually wich I prefer btw) solved the issue.
Back to Top