Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC4 section name with dot

I'm working on a project which has several sections defined as follows:

@RenderSection("Sidebar.Top", false)
<div>somecontent</div>
@RenderSection("Sidebar.Bottom", false)

I want to render something in the bottom sidebar section, but when I use @section Sidebar.Bottom{} I get an error message saying

Cannot resolve section 'Sidebar'

Am I not allowed to use a . in a section name or is there a way to make this work?

like image 856
Bart Beyers Avatar asked Nov 27 '13 12:11

Bart Beyers


3 Answers

you can't use points in a section name, but it's a very good question!

like image 86
jbontinck Avatar answered Oct 17 '22 13:10

jbontinck


You cannot use a "." in the name of a section.

like image 41
Bram Van Strydonck Avatar answered Oct 17 '22 14:10

Bram Van Strydonck


You can't use "."s in section names in ASP.NET MVC 4.0

like image 40
Jente Rosseel Avatar answered Oct 17 '22 13:10

Jente Rosseel