Friday, 15 February 2013

javascript - Call to the controller from Ui is not working -



javascript - Call to the controller from Ui is not working -

im trying phone call action next , got error http404

i want phone call next :

action name:check

controller name :user

what doing wrong?

<div class="form-group" > @using (html.beginform("check", "user", new { name = model.name })) { <input type="button" onclick="location.href='@url.action("check", "user")'" value="check" /> <span id='result'></span> } </div>

take input type submit. have specified controller , action name in form.

<div class="form-group" > @using (html.beginform("check", "user", formmethod.post, new { name = model.name })) { <input type="submit" value="check" /> <span id='result'></span> } </div>

and action:

[httppost] public actionresult check(string name) { // stuff }

or can try:

<input type="button" value="btntext" onclick="window.location.href='/controller/action'">

javascript jquery asp.net asp.net-mvc razor

No comments:

Post a Comment