Skip to content
Loading
HomeController:
  1.         public ActionResult ContactUs()  
  2.         {  
  3.             return View();  
  4.         }  
  5.   
  6.         public ActionResult Header()  
  7.         {  
  8.             return View();  
  9.         }  
 Headr.cshtml
 
  1. @{  
  2.     ViewBag.Title = "Header";  
  3. }  
  4.   
  5. Header

      
  6.   
  7. @section Header{  
  8.     

    hello Header

      
  9. }  
  10.    
 
0
  • Rajeesh Menoth
    0
    Hi Rahul, "RenderSection(string sectionName, bool required):" Please read the article : https://weblogs.asp.net/scottgu/asp-net-mvc-3-layouts-and-sections-with-razor
    0
  • Ashutosh Gupta
    0
     check this. 
     
    1. @{    
    2. ViewBag.Title = "Header";    
    3. }    
    4. @section Header    
    5. {    
    6.   class="Header">    
    7.     

      header

        
    8.     
    9. }    
     
    0