简体   繁体   中英

ASP.NET MVC Html Helper usage

Could anyone guide me how to use MVC html helper to implement to get the same html output below . I am a junior MVC developer trying to learn the stuff.

<ul class="nav fl mrgtp7m nodisp-ie7"> 
    <li class="prdctType">
      <a class="selected" id="A1">Infy Plus®</a> 
      <ul class="subnav" id="Ul1"><li><a>Infy Test Plus®       
       </a></li><li><a>Infy® Test General</a></li></ul>
     </li>
 </ul>

Tried it with HTML dropdown helper but did not get same result.Not sure how can i apply above CSS classes in helper class to achive the same above

 <ul class='nav fl mrgtp7m nodisp-ie7'> 
         <li class='prdctType'>
                @Html.DropDownListFor("Test", new SelectList(listItems , "Value" , "Text") )
          </li>
 </ul>

You don't need any helper classes for this. Use foreach with your model based on the logic that need to implement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM