I am working on asp.net MVC 3 application and I have a layout page with a section like this:
<div class="rt-block">
<div id="rt-mainbody">
@if (IsSectionDefined("BodyTitle"))
{
<div class="rt-headline">
<h1 class="rt-article-title">
@RenderSection("BodyTitle", false)
</h1>
</div>
}
<div class="clear">
</div>
<div>
@RenderBody()
</div>
</div>
</div>
In My View, I am defining the section like this:
@section BodyTitle {
<span>Verify</span> Your Identity
}
partail view here
This View loads one of two partial views depending on link click.
I want that when one partial view is loaded then section has different text where it should have different text when other partial view is loaded. How can I change section contents on change of partial view ?
I tried to move section to partial views but in that case it is not loaded at all. Can't we define section in partial view which is declared in layout view ?
Please suggest