This is a migrated thread and some comments may be shown as answers.

Javascript not firing after Ajax callback

1 Answer 98 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Massimiliano
Top achievements
Rank 1
Massimiliano asked on 16 Jan 2014, 01:23 PM
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">
        alert('test');
   </script>
</telerik:RadScriptBlock>

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.. :)

1 Answer, 1 is accepted

Sort by
0
Massimiliano
Top achievements
Rank 1
answered on 19 Jan 2014, 04:24 PM
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.
Tags
TabStrip
Asked by
Massimiliano
Top achievements
Rank 1
Answers by
Massimiliano
Top achievements
Rank 1
Share this question
or