asp.net mvc - mvc 4 reusable controls in one page -
i new mvc framework. when using web form, user control can assigned parameter in page , can generated unique id in page. though implemented control more 1 time in same page.
in mvc framework, partial view way implement reusable control. got problems below.
how implement same reusable control more once in same page different parameters.
i know renderpartialextensions.renderpartial can pass different viewdata, if partial view implementing javascripts/jquery, generate issue id in same page
you can differentiate id within passed models . can put example unique member model , use inside partial view :
<p id="element@(model.unique.tostring()) ></p>
or avoid id selection inside jscript @ all. example use class selectors
Comments
Post a Comment