In IE, the form value selections are being passed to the controller, but they are not passed in any other browser that I have tried. Why do my form values get used in IE but not in Chrome, Firefox or Safari?
My code is below:
HomeController.cs:
Index.cshtml:
My code is below:
HomeController.cs:
using KendoFilters.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace KendoFilters.Controllers
{
public class HomeController : Controller
{
public ActionResult Index(string nameDD)
{
var listFruits = new List<
Fruit
>
{
new Fruit { Name="Apple", Organic=true },
new Fruit { Name="Orange", Organic=true },
new Fruit { Name="Pear", Organic=true },
new Fruit { Name="Plum", Organic=false }
};
ViewBag.MyNameDDValue = nameDD;
return View(listFruits);
}
}
}
@model IEnumerable<
KendoFilters.Models.Fruit
>
@{
Layout = null;
}
<!DOCTYPE html>
<
html
>
<
head
>
<
meta
name
=
"viewport"
content
=
"width=device-width"
/>
<
title
>Index</
title
>
<!-- Kendo References -->
<
link
rel
=
"stylesheet"
href
=
"~/Content/kendo.common.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"~/Content/kendo.default.min.css"
>
<
link
href
=
"~/Content/kendo.dataviz.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
script
src
=
"~/Scripts/jquery.min.js"
></
script
>
<
script
src
=
"~/Scripts/kendo.all.min.js"
></
script
>
<
script
src
=
"~/Scripts/kendo.aspnetmvc.min.js"
></
script
>
</
head
>
<
body
>
<
div
>
<
table
>
@using (Html.BeginForm("Index", "Home", FormMethod.Get))
{
<
tr
>
<
td
>Environment
</
td
>
<
td
>
@(Html.Kendo().DropDownList()
.Name("nameDD")
.DataTextField("Name")
.DataValueField("Name")
.BindTo(Model)
)
</
td
>
<
td
style
=
"width: 10px;"
></
td
>
<
td
>
<
input
type
=
"submit"
value
=
"Run Report"
/>
</
td
>
</
tr
>
}
</
table
>
<
br
/><
br
/>
You Chose: @ViewBag.MyNameDDValue
</
div
>
</
body
>
</
html
>