我正在尝试将 T4MVC 应用于我的项目。比如说,我有一个 ajax 搜索框,它调用 Home/SearchQuery 操作,该操作将字符串 q 作为参数。如何在 T4MVC 中编写该行?
从 Ajax.BeginForm("SearchQuery", "Home", .... 到 Ajax.BeginForm(MVC.Home.SearchQuery(???)...
.cshtml 文件
@using (Ajax.BeginForm("SearchQuery", "Home", /* <-----Convert to T4MVC Here */
new AjaxOptions {
LoadingElementId = "loadingGif",
OnSuccess = "parseResults",
OnFailure = "searchFailed"
})) {
<input type="text" name="q" />
<input type="submit" value="Search" />
<img id="loadingGif" style="display:none" src="@Url.Content("~/content/images/loading.gif")" />
}
<div id="searchResults" style="display: table"></div>