Помощник с помощью ajax helper BeginForm - PullRequest
0 голосов
/ 02 октября 2009

Кто-нибудь может сказать, почему метод 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 Ответ

1 голос
/ 17 февраля 2010

Используйте «<%», а не «<% =» в начале тега формы! </p>

...