11/* Yet Another Forum.NET
22 * Copyright (C) 2003-2005 Bjørnar Henden
33 * Copyright (C) 2006-2013 Jaben Cargman
4- * Copyright (C) 2014-2023 Ingo Herbote
4+ * Copyright (C) 2014-2025 Ingo Herbote
55 * https://www.yetanotherforum.net/
6- *
6+ *
77 * Licensed to the Apache Software Foundation (ASF) under one
88 * or more contributor license agreements. See the NOTICE file
99 * distributed with this work for additional information
2222 * under the License.
2323 */
2424
25- namespace YAF . SampleWebApplication . Controllers . BaseClass
26- {
27- using System ;
28- using System . Web . Mvc ;
25+ namespace YAF . SampleWebApplication . Controllers . BaseClass ;
26+
27+ using System ;
28+ using System . Web . Mvc ;
2929
30+ /// <summary>
31+ /// The razor controller.
32+ /// </summary>
33+ public class RazorController : Controller
34+ {
3035 /// <summary>
31- /// The razor controller .
36+ /// The razor view .
3237 /// </summary>
33- public class RazorController : Controller
38+ /// <param name="viewName">
39+ /// The view name.
40+ /// </param>
41+ /// <param name="model">
42+ /// The model.
43+ /// </param>
44+ /// <returns>
45+ /// The <see cref="ActionResult"/>.
46+ /// </returns>
47+ public ActionResult RazorView ( string viewName , object model )
3448 {
35- /// <summary>
36- /// The razor view.
37- /// </summary>
38- /// <param name="viewName">
39- /// The view name.
40- /// </param>
41- /// <param name="model">
42- /// The model.
43- /// </param>
44- /// <returns>
45- /// The <see cref="ActionResult"/>.
46- /// </returns>
47- public ActionResult RazorView ( string viewName , object model )
48- {
49- // pass the viewname to RazorView.aspx
50- // the view will be rendered as partial view
51- this . ViewBag . ViewName = viewName ;
49+ // pass the viewname to RazorView.aspx
50+ // the view will be rendered as partial view
51+ this . ViewBag . ViewName = viewName ;
5252
53- return this . View ( "RazorView" , model ) ;
54- }
53+ return this . View ( "RazorView" , model ) ;
54+ }
5555
56- /// <summary>
57- /// The razor view.
58- /// </summary>
59- /// <param name="model">
60- /// The model.
61- /// </param>
62- /// <returns>
63- /// The <see cref="ActionResult"/>.
64- /// </returns>
65- public ActionResult RazorView ( object model )
66- {
67- return this . RazorView ( this . GetCurrentViewName ( ) , model ) ;
68- }
56+ /// <summary>
57+ /// The razor view.
58+ /// </summary>
59+ /// <param name="model">
60+ /// The model.
61+ /// </param>
62+ /// <returns>
63+ /// The <see cref="ActionResult"/>.
64+ /// </returns>
65+ public ActionResult RazorView ( object model )
66+ {
67+ return this . RazorView ( this . GetCurrentViewName ( ) , model ) ;
68+ }
6969
70- public ActionResult RazorView ( string viewName )
71- {
72- return this . RazorView ( viewName , null ) ;
73- }
70+ public ActionResult RazorView ( string viewName )
71+ {
72+ return this . RazorView ( viewName , null ) ;
73+ }
7474
75- public ActionResult RazorView ( )
76- {
77- return this . RazorView ( this . GetCurrentViewName ( ) , null ) ;
78- }
75+ public ActionResult RazorView ( )
76+ {
77+ return this . RazorView ( this . GetCurrentViewName ( ) , null ) ;
78+ }
7979
80- private String GetCurrentViewName ( )
81- {
82- var result = $ "{ this . Url . RequestContext . RouteData . Values [ "action" ] } ";
80+ private String GetCurrentViewName ( )
81+ {
82+ var result = $ "{ this . Url . RequestContext . RouteData . Values [ "action" ] } ";
8383
84- return result ;
85- }
84+ return result ;
8685 }
8786}
0 commit comments