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 - What's the official Microsoft way to track counts of dynamic controls to be reconstructed upon Postback? -


when creating dynamic controls based on data source of arbitrary , changing size, official way to track how many controls need rebuilt page's control collection after postback operation (i.e. on server side during asp.net page event lifecycle) point @ dynamic controls supposed rebuilt? arity stored retrieval , reconstruction usage?

by "official" mean microsoft way of doing it. there exist hacks session storage, etc want know bonafide or @ least microsoft-recommended way. i've been unable find documentation page stating information. code samples work set of dynamic controls of known numbers. it's if doing otherwise tougher.

update: i'm not inquiring user controls or static expression of declarative controls, instead dynamically injecting controls code-behind, whether mine, 3rd-party or built-in asp.net controls.

this depends on problem @ hand, , type of controls you're recreating. simple text boxes or various different complex custom user controls. main thing here is: if want dynamic control regain state after post-back, have re-create in init phase of page life-cycle.

anyway. there's nothing microsoft way or microsoft recommended way basically. when you're dynamically adding several simple controls of same type hidden field count trick, when have several complex controls other ways have used. still hidden fields , save control's full type strings in them (ie. system.web.ui.webcontrols.textbox) , re-instantiate them. think of more complex example of putting various controls on different parts in page... , initializing them specific state. bit more challenging. hence no microsoft way... recommended way recreate in init phase. , that's it.

everything can solved, 1 took wrong direction in ui , things done easier using different approach.

additional explanation

this state-full technique of viewstate asp.net uses considered worse culprit web developers in general. that's why asp.net mvc developers think new framework bliss since more suited state-less http protocol. me being 1 of them. :d


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 -