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

[Solved] scripregistrar issue

0 Answers 23 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pradeep
Top achievements
Rank 1
Pradeep asked on 12 Mar 2012, 08:20 AM
Hi,
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.

Tags
General Discussions
Asked by
Pradeep
Top achievements
Rank 1
Share this question
or