Reputation: 535
I'm trying to remember the Razor syntax in .NET MVC3 to add a block of Javascript codes in a partial view into the footer of the layout. I used it once somewhere which I could not find. I google it but no luck. It goes something like this
@Scripts.Add(@Script.Foot){
<script type="text/javascript">alert("hello everyone");</script>
}
Please help me with the correct this syntax
Thanks in advance
Tri
Upvotes: 2
Views: 3310
Reputation: 888203
You're probably trying to write a section:
@section Footer {
<script type="text/javascript">alert("hello everyone");</script>
}
Upvotes: 2