Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

asp.net mvc - jQuery Sort and MVC Stopped Working -


i getting following error when jquery sort calls sort action:

the parameters dictionary contains invalid entry parameter 'donationids' method 'system.web.mvc.emptyresult sortdonations(system.collections.generic.list1[system.int32])' in 'vol.web.areas.activityarea.controllers.donationcontroller'. dictionary contains value of type 'system.collections.generic.list1[vol.models.token]', parameter requires value of type 'system.collections.generic.list`1[system.int32]'.
parameter name: parameters

jquery:

$("#dlist").sortable({         handle: '.sorthandle',         update: function () {             var order = $('#dlist').sortable('toarray');             $.ajax({                 url: '/activity/donation/sortdonations',                  data: { donationids: order },                 type: 'post',                 traditional: true             });         }     }); 

post values:

parametersapplication/x-www-form-urlencoded donationids 1 donationids 8 source donationids=1&donationids=8 

mvc action:

 public emptyresult sortdonations(list<int> donationids)         {               int order = 0;             foreach (int in donationids)             {                 donationrepository.updatesortorder(i, order);                 order++;             }               return new emptyresult();         } 

it working seems reference class, token. ideas going on or start looking?

enter code herei changed action use string , resolved issue.

     [httppost]         public emptyresult sortdonations(string[] donationorder)   {      int order = 0;      foreach (var in donationorder)     {         donationrepository.updatesortorder(convert.toint32(i), order);         order++;     }       return new emptyresult(); } 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -