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.

What is the difference between the ResourceControllerFactory and the DefaultControllerFactory in ASP.NET MVC? -


what difference between resourcecontrollerfactory , defaultcontrollerfactory in asp.net mvc?

context: looking hook ioc container controller factory - have overriden defaultcontrollerfactory this, see resourcecontrollerfactory being used in project working with.

does 1 provide improved support rest apis?

code each:

defaultcontrollerfactory

public class defaultcontrollerfactory : icontrollerfactory {     // fields     private ibuildmanager _buildmanager;     private controllerbuilder _controllerbuilder;     private controllertypecache _instancecontrollertypecache;     private static controllertypecache _staticcontrollertypecache;      // methods     static defaultcontrollerfactory();     public defaultcontrollerfactory();     internal static invalidoperationexception createambiguouscontrollerexception(routebase route, string controllername, icollection<type> matchingtypes);     public virtual icontroller createcontroller(requestcontext requestcontext, string controllername);     protected internal virtual icontroller getcontrollerinstance(requestcontext requestcontext, type controllertype);     protected internal virtual type getcontrollertype(requestcontext requestcontext, string controllername);     private type getcontrollertypewithinnamespaces(routebase route, string controllername, hashset<string> namespaces);     public virtual void releasecontroller(icontroller controller);      // properties     internal ibuildmanager buildmanager { get; set; }     internal controllerbuilder controllerbuilder { get; set; }     internal controllertypecache controllertypecache { get; set; } } 

resourcecontrollerfactory

public class resourcecontrollerfactory : icontrollerfactory {     // fields     private icontrollerfactory inner;     private const string restactiontoken = "$rest$";      // methods     public resourcecontrollerfactory();     public resourcecontrollerfactory(icontrollerfactory inner);     public icontroller createcontroller(requestcontext requestcontext, string controllername);     public void releasecontroller(icontroller controller);      // nested types     private class resourcecontrolleractioninvoker : controlleractioninvoker     {         // methods         public resourcecontrolleractioninvoker();         protected override actiondescriptor findaction(controllercontext controllercontext, controllerdescriptor controllerdescriptor, string actionname);          // nested types         private class resourceerroractiondescriptor : actiondescriptor         {             // fields             private controllerdescriptor controllerdescriptor;             private string message;             private httpstatuscode statuscode;              // methods             public resourceerroractiondescriptor(controllerdescriptor controllerdescriptor, httpstatuscode statuscode, string message);             public override object execute(controllercontext controllercontext, idictionary<string, object> parameters);             public override parameterdescriptor[] getparameters();              // properties             public override string actionname { get; }             public override controllerdescriptor controllerdescriptor { get; }         }     } }   expand methods 

the resourcecontrollerfactory offers automatic response serialisation according accept http header (i think).


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 -