2009-10-02 6 views
0

Quelqu'un peut-il dire pourquoi la méthode BeginForm que j'utilise dans une aide personnalisée rend ce texte avant la première zone de texte?Aide utilisant ajax helper BeginForm

System.Web.Mvc.Html.MvcForm 

Cela fonctionne également! :) :(

Le code que j'utilise est le suivant:

// 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>" 
     ); 

Répondre

1

utilisation <% 'non '<% =' dans votre balise de début de forme

!