0
I have a form that sends some data, I want to receive this data but one of them is a value, is coming without the correct formatting.
@using (Html.BeginForm("GravarDados", "Aposta", FormMethod.Get))
{
<div class="container droppedHover">
<div class="row">
<div class="input-prepend input-append">
<input class="form-control input-sm " onkeyup="somenteNumeros(this);" id="numero" name="numero" placeholder="número.." maxlength="4" type="text"/>
<input class="form-control input-sm" type="number" id="valor" name="valor" placeholder="valor.."/>
</div>
</div>
<br />
<button class="btn btn-primary btn-block " type="submit" >Adicionar</button>
</div>
}
public ActionResult GravarDados()
{
if (!String.IsNullOrEmpty(Request.QueryString["numero"]))
{
if (!String.IsNullOrEmpty(Request.QueryString["valor"])){
int IdDoUsuario = (int)Session["id"];
int numero = Convert.ToInt32(Request.QueryString["numero"]);
decimal valor = Convert.ToDecimal(Request.QueryString["valor"]);
var tTabela = new JogoTemAplicacao();
tTabela.Inseri(numero, valor, IdDoUsuario);
}
}
return RedirectToAction("Index", "Aposta");
}
Why does it have to be for
QueryString
?– Maniero
I need a solution, whatever it is, I’m accepting.
– Harry