Hullo,
I am trying to update a website from ASP.NET MVC1 to ASP.NET MVC3 and from VS2008 to VS2010. So far everything seems to be going OK except the class FormCollection seems to be completely different across the two visual studios.
I've noticed that in VS2008 there is a FormCollection for version 1 and version 2 (presumably MVC1 and MVC2) and I can't see any big changes with them, but in VS2010 the only FormCollection class there is is a sealed class which is causing me grief as I have a class from before that inherits from FormCollection.
Anyone know if the FormCollection I used to know and love has moved or if I should just rewrite everything using the class that inherits it (a lot of stuff)?
Regards, Harry
Worked my way around it now. Instead of inheriting
FormCollection
now it has it's own field 'form
' which is aFormCollection
instead and it's commands just act on that.Edit:
People were asking for the codes, so here's the old class:
And here's how it is now:
For clarification on why this was being used rather than model binders, this was being used only for testing to easily mock up forms quickly and easily.