I only know a small amount about .NET MVC and haven't used it barely at all so far but I was wondering how would you create re-useable controls that can be spread across different applications?
We have various controls that have been created in external libraries and we reference the assembly if we want to use them. An example would be a date range selector for reports, the user can select two dates which they then post back the page and the controls changed date event is fired and the report is updated.
How would you accomplish this in MVC? I know you can still use the control like you would do normally but this doesn't seem like the way MVC should be used. I thought that normally you would post the form data to a new view, validate the form data and then do whatever is required next. However when this is all encapsulated inside a control how can you possibly split it out over multiple views?
Some points I'm hoping to get out of this question are:
- How do you get around this?
- What sort of work flow do your controls have?
- Do your forms actually post to other pages or do they post back to the same page?
** Update:**
I have found this blog entry from Rob Conery but it doesn't deal with controls it deals with usercontrols. Even with the below method of rendering a control how would you use it to render a control which dealt with a form?
http://blog.wekeroad.com/2008/01/07/aspnet-mvc-using-usercontrols-usefully/