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

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -