CodePaste Logo
New Snippet New Recent Snippets Recent Snippets My Snippets My Snippets My Favorites Favorites Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of script
<!--In Layout - Note that the Render call is made at the end of the body.-->
<!DOCTYPE html>
<html>
    <head>
        <title>@Model.PageTitle</title>
        @Scripts.Add("jquery-1.6.min.js", 100)
    </head>
    <body>
        @Html.Partial("ToolbarView", Model)
        @RenderBody()
by Rob Eisenberg   August 25, 2011 @ 10:05am
Tags: MVC, MVC3, Script
629 Views
no comments
 
C#
public static class Scripts {
    const string ScriptsKey = "Scripts";

    public static MvcHtmlString Add(string src, int priority = 0) {
        var scripts = GetScripts();

        scripts.Add(new Script {
            Src = src,
            Priority = priority
        });
by Rob Eisenberg   August 25, 2011 @ 10:01am
Tags: MVC, MVC3, Script
1106 Views
3 comments
 
brought to you by:
West Wind Techologies