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 - How to get the physical controller class file path of the executing action method? -


assume current executing action method index() in home controller. within index(), how obtain physical file path of home controller? assume don't know file structure until runtime.

the physical file (controller\home.cs) might not exist, since controller compiled .dll, , convention, stored in bin folder.

if .dll want, in bin folder, or use getexecutingassembly within controller.

you can find name of controller using:

request.requestcontext.routedata.values["controller"]; 

you can store location of .cs files in web.config, enough find them. (beware of partial .cs files).

finding controller method next step, since finding method right name not enough. have match parameters , attribute (httppost / actionname).


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 -