asp.net mvc - request a javascript variable into razor -
i have problem, request function not working
here code razor
@{ int = 0; list<abono> ab = model.tolist(); int inicio = convert.toint32(request["inic"]); int fin = convert.toint32(request["ffin"]); var xx = ab.skip(inicio).take(fin); }
script
var inic=0; var ffin=20; function siguiente() { //debugger; var ini = @html.raw(json.encode(@viewbag.inicio)); var fi=@html.raw(json.encode(@viewbag.fin)); $.post("/reportes/getsiguiente", { fin: fi }, function (data) { var dato = data.dias; //alert(dato); debugger; var inic=dato[0]; var ffin=dato[1]; }); }
i traying change razors values.
thanks
remove @viewbag front of variables.
Comments
Post a Comment