HTML.DropDownListFor课堂作业 [英] HTML.DropDownListFor class assignment

查看:155
本文介绍了HTML.DropDownListFor课堂作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能我自己的类分配给HTML.DropDownListFor()帮助?

Is it possible to assign my own class to the HTML.DropDownListFor() helper?

推荐答案

一个重载的方法有一个对象htmlAttributes 中,你可以指定额外的属性,以最后一个参数被添加到生成html

One of the overloaded method has an object htmlAttributes as last parameter in which you can specify extra attributes to be added to the generated html:

Html.DropDownListFor(..., new { "class" = "myclassname" };

http://msdn.microsoft.com/library/ee703670.aspx

这篇关于HTML.DropDownListFor课堂作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆