From 106bf4227ee98a492de8c7481a444b50fda0a2bf Mon Sep 17 00:00:00 2001 From: Erik Zaadi Date: Thu, 5 May 2011 16:35:20 +0300 Subject: [PATCH] continuing to update mvc sample --- .../AdditionalHtmlAndUrlHelpers.cs | 1 + .../MvcApplication/MvcApplication.csproj | 6 ++++-- Samples/MvcSample/MvcUI/MvcUI.csproj | 16 ++++++++-------- .../MvcSample/MvcUI/Views/Shared/Error.aspx | 11 ----------- .../MvcSample/MvcUI/Views/Shared/Error.cshtml | 7 +++++++ .../MvcSample/MvcUI/Views/Shared/Footer.ascx | 2 -- .../MvcUI/Views/Shared/Footer.cshtml | 1 + .../MvcUI/Views/Shared/LoginControl.cshtml | 2 +- .../MvcSample/MvcUI/Views/Shared/Menu.cshtml | 19 ++++++++++++------- 9 files changed, 34 insertions(+), 31 deletions(-) delete mode 100644 Samples/MvcSample/MvcUI/Views/Shared/Error.aspx create mode 100644 Samples/MvcSample/MvcUI/Views/Shared/Error.cshtml delete mode 100644 Samples/MvcSample/MvcUI/Views/Shared/Footer.ascx create mode 100644 Samples/MvcSample/MvcUI/Views/Shared/Footer.cshtml diff --git a/Samples/MvcSample/MvcApplication/Models/HtmlHelpers/AdditionalHtmlAndUrlHelpers.cs b/Samples/MvcSample/MvcApplication/Models/HtmlHelpers/AdditionalHtmlAndUrlHelpers.cs index 13db69d..c790efc 100644 --- a/Samples/MvcSample/MvcApplication/Models/HtmlHelpers/AdditionalHtmlAndUrlHelpers.cs +++ b/Samples/MvcSample/MvcApplication/Models/HtmlHelpers/AdditionalHtmlAndUrlHelpers.cs @@ -4,6 +4,7 @@ using System.Web; using System.Web.Mvc; using System.Text; +using System.Web.WebPages; namespace GithubSharp.Samples.MvcSample.MvcApplication.Models.HtmlHelpers { diff --git a/Samples/MvcSample/MvcApplication/MvcApplication.csproj b/Samples/MvcSample/MvcApplication/MvcApplication.csproj index b794aec..5d0b1bf 100644 --- a/Samples/MvcSample/MvcApplication/MvcApplication.csproj +++ b/Samples/MvcSample/MvcApplication/MvcApplication.csproj @@ -1,4 +1,4 @@ - + Debug @@ -90,7 +90,9 @@ - + + ASPXCodeBehind + diff --git a/Samples/MvcSample/MvcUI/MvcUI.csproj b/Samples/MvcSample/MvcUI/MvcUI.csproj index 542130a..7d843ef 100644 --- a/Samples/MvcSample/MvcUI/MvcUI.csproj +++ b/Samples/MvcSample/MvcUI/MvcUI.csproj @@ -1,4 +1,4 @@ - + Debug @@ -106,11 +106,8 @@ - - - - - + + @@ -136,7 +133,7 @@ - + False True @@ -165,6 +162,9 @@ + + + - + \ No newline at end of file diff --git a/Samples/MvcSample/MvcUI/Views/Shared/Error.aspx b/Samples/MvcSample/MvcUI/Views/Shared/Error.aspx deleted file mode 100644 index f6e27b8..0000000 --- a/Samples/MvcSample/MvcUI/Views/Shared/Error.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage" %> - - - Error - - - -

- Sorry, an error occurred while processing your request. -

-
diff --git a/Samples/MvcSample/MvcUI/Views/Shared/Error.cshtml b/Samples/MvcSample/MvcUI/Views/Shared/Error.cshtml new file mode 100644 index 0000000..7682769 --- /dev/null +++ b/Samples/MvcSample/MvcUI/Views/Shared/Error.cshtml @@ -0,0 +1,7 @@ +@model GithubSharp.Samples.MvcSample.MvcApplication.Models.ViewModels.ErrorViewModel +@section Title { +Error +} +

+ Sorry, an error occurred while processing your request. +

diff --git a/Samples/MvcSample/MvcUI/Views/Shared/Footer.ascx b/Samples/MvcSample/MvcUI/Views/Shared/Footer.ascx deleted file mode 100644 index 278d1fb..0000000 --- a/Samples/MvcSample/MvcUI/Views/Shared/Footer.ascx +++ /dev/null @@ -1,2 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> -Copyright 2011 Erik Zaadi diff --git a/Samples/MvcSample/MvcUI/Views/Shared/Footer.cshtml b/Samples/MvcSample/MvcUI/Views/Shared/Footer.cshtml new file mode 100644 index 0000000..5f71254 --- /dev/null +++ b/Samples/MvcSample/MvcUI/Views/Shared/Footer.cshtml @@ -0,0 +1 @@ +Copyright 2011 Erik Zaadi \ No newline at end of file diff --git a/Samples/MvcSample/MvcUI/Views/Shared/LoginControl.cshtml b/Samples/MvcSample/MvcUI/Views/Shared/LoginControl.cshtml index 50228d5..fe0307b 100644 --- a/Samples/MvcSample/MvcUI/Views/Shared/LoginControl.cshtml +++ b/Samples/MvcSample/MvcUI/Views/Shared/LoginControl.cshtml @@ -21,7 +21,7 @@ @if (!string.IsNullOrEmpty(Model.Message)) {
- @Model.Message%>
+ @Model.Message } diff --git a/Samples/MvcSample/MvcUI/Views/Shared/Menu.cshtml b/Samples/MvcSample/MvcUI/Views/Shared/Menu.cshtml index 0dc7d2d..96e217a 100644 --- a/Samples/MvcSample/MvcUI/Views/Shared/Menu.cshtml +++ b/Samples/MvcSample/MvcUI/Views/Shared/Menu.cshtml @@ -1,16 +1,21 @@ +@{ + var currentController = ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString(); + Func currentOrNot = (string x) => { return currentController == x ? "CurrentAPI" : ""; }; + +}