如果我的HTML看起来像这样:
<td class="controlCell">
<input class="inputText" id="SearchBag.CompanyName" name="SearchBag.CompanyName" type="text" value="" />
</td>
Run Code Online (Sandbox Code Playgroud)
我怎么能用JQuery选择#SearchBag.CompanyName?我无法让它发挥作用,我担心这是打破一切的点.令人讨厌的是,重命名我所有的id将是很多工作,更不用说可读性的损失.
给定以下类和控制器操作方法:
public School
{
public Int32 ID { get; set; }
publig String Name { get; set; }
public Address Address { get; set; }
}
public class Address
{
public string Street1 { get; set; }
public string City { get; set; }
public String ZipCode { get; set; }
public String State { get; set; }
public String Country { get; set; }
}
[Authorize(Roles = "SchoolEditor")]
[AcceptVerbs(HttpVerbs.Post)]
public SchoolResponse Edit(Int32 id, FormCollection form)
{
School school = …Run Code Online (Sandbox Code Playgroud)