MVC is great! page lifecycle

2 posts, 0 answers
  1. Vjeran Ivičić
    Vjeran Ivičić avatar
    24 posts
    Member since:
    Oct 2005

    Posted 03 Mar 2009 Link to this post

    well i couldn't resist not to post this. Well yesterday i lost my whole day on trying to make an custom control that will use RadDatePicker, RadNumbericTextBox, RadioButtonList and TextBox based on DbType Enumeration and EntityValue property. My sql table has each field for each type.

    So, when we take into concern famous page lifecycle and order of events - i must say bravo telerik! That's is just an nightmare when u try to crreate something dynamic and when u need to get previous state. In my case i couldn't make initialization bfore databinding because my control is in gridview item so properties and everything will be binded on databinding of parent.

    I did this control to work and to return state but then - when edit even occurs - nightmare starts again! Now databind still didn't happen so i don't have properties - my control that is located in e.EditgridItem is recreated but - how - not correctly. Because it is needs properties and it gets those later. All in all that page lifecycle is undermining itself. So in case of databinding all those previous events are just useless and when u need to make something that will work without some 100 pages manual u must make many hacks and at the end u will remeber how it was, before, in times of asp or php. I can't imagine what problem u guys from telerik had to make all those controls and to fix all those cases of use.

    So.. all i can tell is  - telerik MVC control suit - Buckle your seatbelt, Dorothy, 'cause Kansas (web forms) is going bye-bye.

    Shame - some gurus like Flowers where attacked while they where presenting simple approaches by some "MS only" people. Some people will tell that RAD is hell when things go wrong and when project is big, but that's just because of web froms and not guilt of some controls producer.

    At the end, my only way to resolve this damn situation (withour reading some detailed book) is to place controls directly - and to bind to visibility.
  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 27 Mar 2009 Link to this post

    Hello Vjeran-

    Sounds like you had a tough time. Not quite sure if there is a question burried in your post, but it looks like you managed to solve your problem by resulting to a simpler approach (which is usually the best approach). :)

    As you know, WebForms can be complex, especially when you start nesting controls in controls- in edit forms! I don't disagree that troublshooting these situations can get very hard very quick. MVC will simplify things in a way, but perhaps not how you think. If you look at MVC, there is no grid equivelant! MVC is very much rooted in the idea that pages peform a single function (a few simple but distinct functions) and it is not designed to do the typical Edit/Insert/View/Sort/Filter/Group all on a single page like we do with WebForms today. The end effect is simpler pages and easier development, but the reason is partly due to the shift in approach. Make sense?

    In any event, I hope you enjoy the RadControls in MVC or WebForms. If you need help in the future, the Forums are always here for you.

Back to Top