A
A
Anton Martsen2014-05-29 14:12:06
JavaScript
Anton Martsen, 2014-05-29 14:12:06

Parameters not being sent via GET ASP.NET MVC?

Good afternoon!

There is a view code

@model Project.Models.Order

@using (Ajax.BeginForm("Update", "OrderLog", null, new AjaxOptions() { HttpMethod = "get", InsertionMode = InsertionMode.Replace, UpdateTargetId = String.Format("order_{0}", Model.ID) }, new { onsubmit = String.Format("show_wait_notification('order_{0}')", Model.ID)}))
{
//Куча HTML
            <input name="order_id" type="hidden" value="@(Model.ID)" />
//Куча HTML
}


There is a method in the controller that reacts to the submit:

public ActionResult Update()
        {

            string key = Request.QueryString["order_id"];
            
            int id;
            bool result = int.TryParse(key, out id);

            Order order = null;

            if (result == true)
            {
                order = service.Get().Where(o => o.ID == id).FirstOrDefault();

//БИЗНЕС-ЛОГИКА
//....
              }

            return PartialView(order);
        }


When I work through Chrome, Request.QueryString contains the parameters I need.
In IE comes emptiness.

Most likely the code of the curve, but I live with what I have.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Martsen, 2014-05-30
@martsen

Abandoned Ajax.BeginForm and implemented via jQuery AJAX Api.
The flight is normal.
But the question is still open.

A
Alexey, 2014-05-31
@HaJIuBauKa

You can try to specify explicitly in the controller:
although what does IE have to do with it :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question