asp.net - Partial view for container -


say, i'm using following html in asp.net mvc application:

<div class="a">   <div class="b">      (varying content)   </div> </div> 

i'd put repeating div part separate file , reuse (notice, content may, , change). how can that?

keep in partialview, eg: _commondiv

call partial view view

@html.partial("_commondiv", null, new viewdatadictionary {{ "yourvaringcontentkey", yourcontent}}) 

get content in partialview

string yourcontent= (string)this.viewdata["yourvaringcontentkey"]; 

and use same want.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -