jquery - Return value from controller using $.param in MVC -


i using asp.net mvc, in application update image using following:

controller:

public actionresult outputhandler(int slide = 0)         {             filecontentresult data;             im = object(slide) ......             using (var memstream = new memorystream())             {                 objimage1.save(memstream, imageformat.png);                 data = this.file(memstream.getbuffer(), "image/png");             }             objimage1.dispose();             return data;         } 

in view use,

imge.src = '/home/animate?' + $.param({   ....  slide: parseint(intervalcounter),  mprtype: 0,  udm: ++udm   }); 

it works well, need value of slide controller update variable in view.

viewbag helpful in these situations. dynamic variable can used store data controller , used in view.

in controller can set

viewbag.slide = slide 

and in view can need data

@viewbag.slide 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -