weixin_33695082 2016-05-19 12:19 采纳率: 0%
浏览 18

MVC Ajax renderaction部分

I'm a nube, so my question can be simple, but I'm already stuck for a two days because of it. So, I have an html form, in which client can leave their contact data like

<form>
    <input id="name" type="text" placeholder="Имя"><br>
    <input id="Email" type="text" placeholder="E-mail"><br>
    <input id="phonenumber" type="text" placeholder="Телефон"><br>
    <input id="adress" type="text" placeholder="Адрес"><br>
    <textarea id="comment" placeholder="Комментарий"></textarea>
    <button id="submit" class="send" value="Отправить">Отправить</button>
</form>

And I wish to catch it on my controller

[HttpPost]
public ActionResult setupRequest(AirconditioningSetupRequestModel model)
{ 
    //model goes to DB
    return View();
}

How can I deal with that with AJAX? Help me please.

  • 写回答

3条回答 默认 最新

  • weixin_33720186 2016-05-19 12:29
    关注

    Use something like this: string name=Request.Form["name"]; etc...

    评论

报告相同问题?