Guest User

Untitled

a guest
Nov 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using System.Web.Routing;
  7. using ContentManagement;
  8.  
  9. namespace TemplateWebApplication.Controllers
  10. {
  11.     public class RapportDirektController : Controller
  12.     {
  13.         private ContentManager _contentManager;
  14.        
  15.         protected override void Initialize(RequestContext requestContext)
  16.         {
  17.           _contentManager = new ContentManager();
  18.  
  19.            base.Initialize(requestContext);
  20.         }
  21.  
  22.         //
  23.         // GET: /RapportDirekt/
  24.  
  25.         public ActionResult Index()
  26.         {
  27.             ContentItem titleContent = _contentManager.GetSingle("//rapportdirekt/title");
  28.             ViewBag.Title = titleContent.Value;
  29.  
  30.             ContentItem headerContent = _contentManager.GetSingle("//rapportdirekt/header");
  31.             ViewBag.Header = headerContent.Value;
  32.  
  33.             ContentItem mainBodyContent = _contentManager.GetSingle("//rapportdirekt/mainbody");
  34.             ViewBag.MainBody = mainBodyContent.Value;
  35.  
  36.             return View();
  37.         }
  38.  
  39.     }
  40. }
Add Comment
Please, Sign In to add comment