Click here to Skip to main content
15,879,535 members
Articles / Web Development / ASP.NET

MVC Basic Site: Step 1 – Multilingual Site Skeleton

Rate me:
Please Sign up or sign in to vote.
4.90/5 (98 votes)
25 Oct 2013Ms-PL15 min read 405.2K   16.1K   319  
This article is intended to be the first one from this series and is focused mainly in the creation of a multilingual MVC web site skeleton.
@using MvcBasicSite.Models;
@{
    int culture = SiteSession.CurrentUICulture;
    string pageTitle = string.Format("{0} - {1}", Resources.Resource.WebAppTitle, ViewBag.Title);
}
<!DOCTYPE html>
<html>
<head>
    <title>@pageTitle</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/dd.css")" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="page">
        <div id="header">
            @Html.Partial("_Header")
            <div id="menucontainer">
                <ul id="menu">
                    <li>@Html.ActionLink(Resources.Resource.MenuHome, "Index", "Home")</li>
                    <li>@Html.ActionLink(Resources.Resource.MenuAbout, "About", "Home")</li>
                </ul>
            </div>
        </div>
        <div id="main">
            @RenderBody()
        </div>
        <div id="footer">
            @Html.Label("Copyright © 2013 - Raul ILOC")
        </div>
    </div>
    <script type="text/javascript">
        var paramObject = {
            UrlChangeCulture: '@Url.Content("~/Account/ChangeCurrentCulture")'
        }

        function changeCurrentCulture(culture) {
            document.location = paramObject.UrlChangeCulture + "?culture=" + culture;
            return true;
        }
       
    </script>
    @Content.Script("jquery-1.5.1.min.js", Url)
    @Content.Script("jquery.unobtrusive-ajax.min.js", Url)
    @Content.Script("jquery-ui-1.8.11.min.js", Url)
    @Content.Script("jquery.dd.js", Url)
    @Content.Script("Layout.js", Url)
    @RenderSection("scripts", false)
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Romania Romania
I have about 20 years experiences in leading software projects and teams and about 25 years of working experience in software development (SW Developer, SW Lead, SW Architect, SW PM, SW Manager/Group Leader).

Comments and Discussions