Implement MachineKey.Protect and MachineKey.Unprotect
[mono.git] / mcs / class / System.Web.Mvc2 / System.Web.Mvc / Html / RenderPartialExtensions.cs
1 /* ****************************************************************************\r
2  *\r
3  * Copyright (c) Microsoft Corporation. All rights reserved.\r
4  *\r
5  * This software is subject to the Microsoft Public License (Ms-PL). \r
6  * A copy of the license can be found in the license.htm file included \r
7  * in this distribution.\r
8  *\r
9  * You must not remove this notice, or any other, from this software.\r
10  *\r
11  * ***************************************************************************/\r
12 \r
13 namespace System.Web.Mvc.Html {\r
14     public static class RenderPartialExtensions {\r
15         // Renders the partial view with the parent's view data and model\r
16         public static void RenderPartial(this HtmlHelper htmlHelper, string partialViewName) {\r
17             htmlHelper.RenderPartialInternal(partialViewName, htmlHelper.ViewData, null /* model */, htmlHelper.ViewContext.Writer, ViewEngines.Engines);\r
18         }\r
19 \r
20         // Renders the partial view with the given view data and, implicitly, the given view data's model\r
21         public static void RenderPartial(this HtmlHelper htmlHelper, string partialViewName, ViewDataDictionary viewData) {\r
22             htmlHelper.RenderPartialInternal(partialViewName, viewData, null /* model */, htmlHelper.ViewContext.Writer, ViewEngines.Engines);\r
23         }\r
24 \r
25         // Renders the partial view with an empty view data and the given model\r
26         public static void RenderPartial(this HtmlHelper htmlHelper, string partialViewName, object model) {\r
27             htmlHelper.RenderPartialInternal(partialViewName, htmlHelper.ViewData, model, htmlHelper.ViewContext.Writer, ViewEngines.Engines);\r
28         }\r
29 \r
30         // Renders the partial view with a copy of the given view data plus the given model\r
31         public static void RenderPartial(this HtmlHelper htmlHelper, string partialViewName, object model, ViewDataDictionary viewData) {\r
32             htmlHelper.RenderPartialInternal(partialViewName, viewData, model, htmlHelper.ViewContext.Writer, ViewEngines.Engines);\r
33         }\r
34     }\r
35 }