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
Post a Comment