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

ScriptRegistar OnDocumentReady in new Razor Engine of MVC 3 RC

2 Answers 100 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.
Greg Roberts
Top achievements
Rank 1
Greg Roberts asked on 22 Nov 2010, 06:20 AM
How do you use the new Razor syntax to add multiple  lines to the OnDocumentReady method of the ScriptRegistrar?
I currently have it working like this:
 
@{
    string docReady = "$('#preferences_button').button({icons: {primary: 'tool-settings'}, text: false});";
    docReady += "$('#account_menu').menu({ content: $('#account_menu').next().html(),showSpeed: 200});";
    }
        
   
@Html.Telerik().ScriptRegistrar().OnDocumentReady(docReady)

But obviously this is less than ideal.  I tried using the @<text> syntax, but couldn't get it to work.  Does anyone have a working example with the RC build?

2 Answers, 1 is accepted

Sort by
0
a c
Top achievements
Rank 1
answered on 22 Nov 2010, 11:00 AM
see this razor demo: http://mvcdemo.chiplex.com
0
Greg Roberts
Top achievements
Rank 1
answered on 22 Nov 2010, 05:05 PM
Not sure this really answers my question, since I couldn't find multi-line statements using OnDocumentReady there.  This site does help though.
Tags
General Discussions
Asked by
Greg Roberts
Top achievements
Rank 1
Answers by
a c
Top achievements
Rank 1
Greg Roberts
Top achievements
Rank 1
Share this question
or