Ajax inside Button Click (Getting parameter / Asp.NET MVC)

Posted by Ph.E on Stack Overflow See other posts from Stack Overflow or by Ph.E
Published on 2010-03-26T17:56:19Z Indexed on 2010/03/26 18:33 UTC
Read the original article Hit count: 374

Filed under:
|

Greetings gentlemen

I'm trying to implement the following code in my View, and unfortunately I'm not getting. The event is called, but I can not receive the parameter.

Does anyone have any ideas?

Method:

<p><%= Html.AjaxButtonLink("btnExcluir","btnExcluir","Excluir", null, Url.Action("Excluir", new { IdMenu = Model.MenuInfo.Id_menu })) %></p>

HTML:

<p><input id="btnExcluir" name="btnExcluir" onClick="Sys.Mvc.AsyncHyperlink.handleClick(&quot;/Gerencial/MENUACAO/Excluir/60?IdMenu=60&quot;, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'Post' });" type="button" value="Excluir"></input></p>

Controller:

    [ AcceptVerbs(HttpVerbs.Post) ]
    public ActionResult Excluir(string IdMenu)

string IdMenu always come null!

================

Differences

ActionLink:

<p><a href="/Gerencial/MenuAcao/Excluir/60?IdMenu=60" onclick="Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'Post' });">Excluir</a></p>

My Button:

<p><input id="btnExcluir" name="btnExcluir" onClick="Sys.Mvc.AsyncHyperlink.handleClick(&quot;/Gerencial/MENUACAO/Excluir/60?IdMenu=60&quot;, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'Post' });" type="button" value="Excluir"></input></p>


Thanks

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about asp.net-ajax