Помощник с помощью ajax helper BeginForm

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

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

Другие вопросы по тегам