助手使用ajax助手BeginForm

时间:2009-10-02 14:43:52

标签: ajaxform ajax-forms

有人可以说为什么我在自定义助手中使用的方法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>"
        );

1 个答案:

答案 0 :(得分:1)

在开始表单代码中使用'&lt;%'not'&lt;%='!