【发布时间】:2011-11-20 01:03:38
【问题描述】:
我正在用 asp.NET 编写一个应用程序,我使用 MVC 3 模型(视图引擎 Razor)。在 jQuery 自动完成中搜索合适的名称并在名称上按 Enter 后,我不知道该怎么做,应用程序将检查适当的 RadioButton。
<script type="text/javascript">
$(function () {
$("#tags").autocomplete({
source: "/Home/TakeGry",
minLength: 1,
select: function (event, ui) {
// I suspect that something needs to add here
}
});
});
</script>
<table>
<tr>
<th>
<div class="demo">
<div class="ui-widget">
<label for="tags">Surowce: </label>
<input id="tags" />
<input id="hiddenElementID" type="hidden" />
</div>
</div>
</th>
<th>
</th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Nazwa)
</td>
<td>
// One of these RadioButton's should be checked, when I hit enter
@Html.RadioButtonFor(modelItem => item.GraID, new { id = item.GraID })
</td>
</tr>
}
【问题讨论】:
标签: c# javascript jquery asp.net radio-button