T4MVC and Ajax method with parameter
- by Tom
I am trying to apply T4MVC to my project. Say, I have an ajax search box, it calls Home/SearchQuery action which takes in a string q as parameter. How do I write that line in T4MVC?
From Ajax.BeginForm("SearchQuery", "Home", ....
To Ajax.BeginForm(MVC.Home.SearchQuery(???)...
.cshtml file
@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>