This question is locked. New answers and comments are not allowed.
Hi,
I used to call a function in my js file using scriptregistrar in aspx file as below...
and in the test.js file..
var testUrl=null;
I used to call a function in my js file using scriptregistrar in aspx file as below...
<%
= Html.Telerik().ScriptRegistrar().Scripts(scripts =>scripts.AddGroup("Test", group =>group.Add(
"~/Scripts/test.js")))
%>
<% Html.Telerik().ScriptRegistrar().OnDocumentReady(() =>
{
%>
var options = {
TestingUrl: '<%: Url.Action("Post", "Home")%>';
}
testing.init(options);
<%
});
%>
and in the test.js file..
var testUrl=null;
var testing= function () {
var init = function (options) {
testUrl= options.TestingUrl;
}
return { init: init }
} ();
and while debugging im getting testUrl value as null instaed of valid Url value.
Please let me know how can i get the valid value for testUrl(global variable) in js file.