Select from following answers:- By using @RenderOptionalSection method
- By using @OptionalSection method
- By using @RenderSection method and passing 2nd parameter as false

- No, we can't
- All Above
By default @RenderSection("sectionName") method searches for the section sectionName that is defined in the view page.
@section sectionName {
@Scripts.Render("~/bundles/jqueryval")
}
However, if we want to make the section optional; we can pass 2nd parameter of the @RenderSection method to false that will ignore if section is not defined in the view page.
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator