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.

serialization - Need to Seriazlize List<object>, but FXCop complains "Do not expose generic lists" -


i have object need serialize. object contains several properties, including list. fxcop complaining should not expose generic lists, , that, however, due fact can't specify interface based property on object want serialized i'm not sure turn next.

any thoughts?

btw, i'm using xmlserialization, that's not requirement.

i took fxcop's suggestion , wrapped list in collection. blew of code out of water, after few adjustments , running again.

here's code showing before , after:

before:

   public class persistentdataview     {         public string title { get; set; }         private list<object> inputs { get; set;}     } 

after:

    public class persistentdataview     {         private list<object> _inputs;          public string title { get; set; }         public collection<object> inputs         {                         {                 if (_inputs == null)                     _inputs = new list<object>();                  //wrap private field collection.                 return new collection<object>(_inputs);             }         }   } 

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 -