This question is locked. New answers and comments are not allowed.
Hello,
I have a view where I use "ScriptRegistrar().OnDocumentReady()" to output some JavaScript. That works just fine and gets rendered in the "jQuery(document).ready(...)". Now I have a partial view that gets rendered in a Telerik Window via "detailsDialog.ajaxRequest("/Admin/User/DetailsBox/" + userId);". In this partial view I call
@{ Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Add("~/Scripts/b4.jquery.multiselect.js")); }
to include a JavaScript file and
@{
Html.Telerik().ScriptRegistrar().OnDocumentReady(
@<text>
$("assignedRoles").multiselect(
checkAllText = @_("RuleSelector.CheckAll.Text"),
uncheckAllText = @_("RuleSelector.UncheckAll.Text"),
noneSelectedText = @_("RuleSelector.NoneSelected.Text"),
selectedText = @_("RuleSelector.SelectedText.Text")
);
</text>);
}
to add some more stuff to the "jQuery(document).ready(...)". These two items are not rendered. There is no include for that script file and the JavaScript code is not added to the document ready method.
What is the problem?
I have a view where I use "ScriptRegistrar().OnDocumentReady()" to output some JavaScript. That works just fine and gets rendered in the "jQuery(document).ready(...)". Now I have a partial view that gets rendered in a Telerik Window via "detailsDialog.ajaxRequest("/Admin/User/DetailsBox/" + userId);". In this partial view I call
@{ Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Add("~/Scripts/b4.jquery.multiselect.js")); }
to include a JavaScript file and
@{
Html.Telerik().ScriptRegistrar().OnDocumentReady(
@<text>
$("assignedRoles").multiselect(
checkAllText = @_("RuleSelector.CheckAll.Text"),
uncheckAllText = @_("RuleSelector.UncheckAll.Text"),
noneSelectedText = @_("RuleSelector.NoneSelected.Text"),
selectedText = @_("RuleSelector.SelectedText.Text")
);
</text>);
}
What is the problem?