Ajax.从Ajax创建的ActionLink.RenderPartial视图中的BeginForm
Ajax.ActionLink created from Ajax.BeginForm in a RenderPartial View
我想确认这个限制是设计的还是我做错了什么:
我有一个视图与两个RenderPartials:
@model Heelp.ViewModels.CompanyIndexViewModel
@{ Html.RenderPartial(MVC.Company.Views.IndexSearch, Model.SearchViewModel); }
@{ Html.RenderPartial(MVC.Company.Views.IndexMap, Model.MapViewModel); }
在第一个局部视图中,我有一个Ajax。BeginForm:
@model Heelp.ViewModels.CompanyIndexSearchViewModel
@using (Ajax.BeginForm(MVC.Company.CategoryGetAllBySearch(), new AjaxOptions { UpdateTargetId = "searchCompanyResults", InsertionMode = InsertionMode.Replace }, new { @id = "searchBoxWrap" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(m => m.IsCenterFromUser)
@Html.HiddenFor(m => m.CenterLat)
@Html.HiddenFor(m => m.CenterLng)
@Html.HiddenFor(m => m.Zoom)
@Html.HiddenFor(m => m.SearchRadius)
@Html.TextBoxFor(m => m.Search, new { @placeholder = @HeelpResources.CompanyIndexViewSearchPlaceholder })
<input type="button" value="«" id="clearKeywords"/>
@Html.TextBoxFor(m => m.Location, new { @placeholder = @HeelpResources.CompanyIndexViewLocationPlaceholder })
<input type="button" value="«" id="clearLocation"/>
<input type="button" value="X" id="hereButton"/>
<input type="submit" value="@HeelpResources.CompanyIndexViewSearchButtonLabel"/>
}
<div id="searchCompanyResults" class="clearfix" style="z-index: 10; position: absolute; width: 400px;"></div>
Ajax。BeginForm在searchCompanyResultsdiv中生成一个带有Ajax列表的PartialView。ActionLink:
@model Heelp.ViewModels.CategoryGetAllBySearchListViewModel
<p class="float-left margin-top align-left"><span>Encontrámos <em><a href="#">@Model.TotalSearchCount</a></em> resultados nas categorias:</span></p>
<div class="clear-both">
<div id="searchResultsList" class="float-left">
<ul>
@foreach (var item in Model.CategoryGetAllBySearch)
{
<li>
@Ajax.ActionLink(
String.Format("{0} {1} ver »", item.SearchCount, item.Name),
MVC.Company.GetAllByCategory(item.Id, Model.Search, Model.Location, Model.IsCenterFromUser, Model.CenterLat, Model.CenterLng, Model.SearchRadius),
new AjaxOptions { OnBegin = "CompanyGetAllByCategoryOnBegin(" + item.Id + ")", OnSuccess = "CompanyGetAllByCategoryOnSuccess" })
</li>
}
</ul>
</div>
</div>
这里的问题是,如果我不包含指向"
相关文章:
- 如何处理Ajax.BeginForm()OnError OnFailure回调
- 使用jQuery的.on()方法阻止Ajax.BeginForm中提交的默认行为
- Ajax.BeginForm标识在OnComplete方法中单击的按钮
- ajax.beginform() 不更新部分视图 MVC
- 无法重载 Ajax.BeginForm 的提交方法
- 如何通过AJAX.BeginForm'onsuccess被称为
- Ajax.BeginForm 确认无法正常工作
- 部分视图在 ajax.beginform 之后不会更新
- Ajax.BeginForm 强制完全回发
- Ajax.BeginForm() 不会回发到控制器
- 查看从 Ajax.BeginForm 返回的数据
- 如果使用 AJAX 呈现部分视图,则 Ajax.BeginForm 发布两次
- 使用JavaScript提交Ajax.BeginForm()
- 在Ajax.BeginForm的“确认”对话框中添加对象routedValue
- AJAX.beginform is javascript,isn't it?
- 使用Ajax.BeginForm更新表单
- 当Ajax.BeginForm时在Internet Explorer 8上添加的jQuery属性
- Ajax.BeginForm淡出不起作用
- 无法使用 Ajax.BeginForm() 异步上传文件
- OnSuccess脚本在我的Ajax.BeginForm正在传递错误的数据