views:

157

answers:

1

Can anyone say why the method BeginForm that I use in a custom helper is rendering this text beforing the first text box?

System.Web.Mvc.Html.MvcForm

It's also working! :) :(

The code I use is the following:

// 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  A: 

Use '<%' not '<%=' in your begin form tag!

willemaster