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# and ASP.NET custom property attributes and determining if properties changed -


i working on project want keep history of particular object. on save want method on object determine if has changed can call method save current state history. e.g. populate form object user makes changes (or possibly not) , submits from. want take original object , copy of object has been updated form , determine if has changed @ all. additionally may decide @ point properties don't matter (e.g. if name changes won't track it).

i'm thinking easiest/most flexible way accomplish if give properties care custom attribute [changetracked] , use reflection list of properties attribute , loop through them comparing a.property == b.property determine if have changed.

would work? there better/easier way handle this, sort of built in method can add object determine if values of properties have changed? whatever solution psudo code appreciated. point of clarification solution needs determine if value care has changed not if has been assigned since created i.e. if set name="bob" , "bob" before assignment not count change.

it ain't fancy, tried , true brute force method. add private property object named isdirty. properties want track, add isdirty=true property set routine. more complicated "do care" rules, code them property set.

the page button's click event can fire save event writes values textboxes , dropdowns object properties, calls object save method, tests isdirty property before doing anything.


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 -