Im Facing a weird problem on my JQuery mobile APP in MVC4:
I have a form with a couple of texboxes like this
@using Models
@model Models.DataModel.Pagina_Details
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
@using (Html.BeginForm("Pagina_Details", "Home", FormMethod.Post, new { id = "PaginaDetailsForm" }))
{
if (Request.QueryString["Command"] != null)
{
Session["Command"] = Request.QueryString["Command"];
}
else
{
Response.Redirect("Index");
}
<div class="ui-corner-all custom-corners ui-shadow">
<div class="ui-bar ui-bar-a">
<h3>Pagina's</h3>
</div>
<div class="ui-body ui-body-a">
<input type="hidden" id="Command" />
@Html.HiddenFor(model => model.ID)
@Html.LabelFor(model => model.Name, "Naam *", new { @class = "lbl"})
@Html.TextBoxFor(model => model.Name, new { required = "required" })
@Html.LabelFor(model => model.Description, "Omschrijving *", new { @class = "lbl"})
@Html.TextArea("Description", new { required = "required", rows="10", cols="80"})
@Html.LabelFor(model => model.MetaDescription, "Meta description", new { @class = "lbl" })
@Html.TextBoxFor(model => model.MetaDescription)
@Html.LabelFor(model => model.MetaKeywords, "Meta keywords", new { @class = "lbl" })
@Html.TextBoxFor(model => model.MetaKeywords)
@Html.LabelFor(model => model.Active, "Actief", new { @class = "lbl" })
@Html.CheckBoxFor(model => model.Active)
@if (Session["Command"] == "Insert" || Request.QueryString["Command"] == "Insert")
{
<button type="submit" name="Command" data-role="button" data-icon="plus">Toevoegen</button>
}
@if (Session["Command"] != "Insert" && Request.QueryString["Command"] != "Insert")
{
<button type="submit" id="Edit" name="Command" value="Opslaan" data-role="button" data-icon="edit">Opslaan</button>
<button type="submit" id="Verwijderen" name="Command" value="Verwijderen" data-role="button" data-icon="delete">Verwijderen</button>
}
</div>
</div>
}
in my ActionResult (Controller) i have the param Command and use that in a switch to do something with it the issue is on the desktop browser it works well and i can see the command is passing to the ActionResult and everything works fine as it should be but for some reason when i try the same thing on my Mobile phone with Phonegap the Command value will always be null
What i tryed: AttributeUsage How do you handle multiple submit buttons in ASP.NET MVC Framework? no result at all.
also i tried different ActionResults for the 2 buttons no result at all.
im lost does someone knows some tips or have any ideas how i can fix this. ty for your time and help.