我在jQuery中为我的项目做了很多编码,但是我需要帮助获取由Helper with后缀生成的参数名称。MVC3 - DataAnnotation - propertys name
当我这样做:
Html.TextBoxFor(model => model.SomeTextParameter)
在纯HTML还有的生成ID: “SomeTextParameter”。我想要在jQuery中使用它的每个地方自动生成它的id。怎么做?
或者,我可以随时manualy指定要使用的辅助无“对于”它的名字:
Html.TextBox("SomeTextParameter", this.Model.SomeTextParameter)
在这种情况下,我可以控制,方便IDS,但是当我想使用数据注释的标签,然后我发现连接[Display(Name = "Really important text parameter")]
与 Html.Label("SomeTextParameterLabel", <what to enter here?>)
的另一个问题。
当我使用:
Html.LabelFor(model => model.SomeTextParameter)
它结合,所以它显示,就像我想显示的名称。
任何想法如何解决第一或第二个问题?