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.

c# - to pass data around using event handling -


anyone can detail pros , cons pass data 1 class using event mechanism? when best time use event pass data?

let's take example. have system 20 people subscribed weather station changes in weather. want weather station keep track of people , services subscribed?

in opinion weather station should not know people or services waiting weather changes. weather station should dispatch event, , whoever listening notified :-)

so point is, use events notify observers action or state change occurred in object. observers can difference type of objects since don't have know them. if listens object, takes care of it.

if 1 one relation , object waiting happen of same type, wouldn't need event case.

events great decouple systems, seen in example above weather station. weather station can run on own without knowing services or users listening it.


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 -