【发布时间】:2009-10-02 14:43:51
【问题描述】:
谁能说出为什么我在自定义助手中使用的 BeginForm 方法会在第一个文本框之前呈现此文本?
System.Web.Mvc.Html.MvcForm
它也有效! :) :(
我使用的代码如下:
// The helper signature
public static string Pagination(this HtmlHelper helper, int currentPage, int totalPages, string orderBy, string orderDirection, string listArea)
// Ajax helper declartion
AjaxHelper ajaxHelper = new AjaxHelper(helper.ViewContext, helper.ViewDataContainer);
// Form html generation
sb.Append(
ajaxHelper.BeginForm(
helper.ViewContext.RouteData.Values["action"].ToString(),
new AjaxOptions { UpdateTargetId = listArea, LoadingElementId = "loading" }
)
+ helper.TextBox("page")
+ helper.Hidden("orderBy", orderBy)
+ helper.Hidden("orderDirection", orderDirection)
+ "<input type=\"submit\" value=\"" + Localization.GetText("Go") + "\" /></form>"
);
【问题讨论】:
标签: ajaxform ajax-forms