c# - Send parameters in teleric controller -


i have teleric kendo ui automatic generated chart controller. , need send parameter. want load chart partial view , tryed send parameter this:

@html.partial("~/views/graphs/tablestatementschart.cshtml", new  { @model.servicesmodel.id } ); 

this doesn't work me, okay, tryed code:

@{html.renderpartial(                 "~/views/graphs/tablestatementschart.cshtml",                 new { id = model.servicesmodel.id });             } 

and after had no data in chart diagram. how send model id in controller?

this code of controller:

namespace narkomapp.controllers.graphs {     public class tablestatementschartcontroller : controller     {     private narkomdb db = new narkomdb();      int idservice = 0;      public actionresult tablestatementschart(int id)     {         idservice = id;         return view("~/views/graphs/tablestatementschart.cshtml");     }      [httppost]     public actionresult tablestatements_read(int id)     {         idservice = id;         return json(db.tablestatements.select(tablestatements => new         {             fkidservices = tablestatements.fkidservices,             month = tablestatements.month,             count = tablestatements.count,             donecount = tablestatements.donecount,             topicalcount = tablestatements.topicalcount         }).where(x=>x.fkidservices == idservice));     }      protected override void dispose(bool disposing)     {         db.dispose();         base.dispose(disposing);     }   } } 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -