Choosing user control
I am using MVC3 Razor for my project. I am new to this technology. I need to create开发者_运维问答 a user control. When i am trying to add a new item it is giving me the options like
- MVC3 partial page(Razor)
- MVC3 View usercontrol(Aspx)
- Web User Control
Which one i should select? and which folder it should be placed? in Shared folder or some other folder?
You should select MVC 3 partial page (Razor). You should just be aware that the Razor view engine does not support user controls in the way that WebForms does.
You can place it in the Shared folder if it can be used from multiple different controllers. If not, you should place it in the controller-specific views folder.
精彩评论