This week I am doing a few days PD on the new ASP.NET MVC Framework.
I came across a problem when using server controls with MVC based ViewPage (which is inherited from System.Web.UI.Page) class.
Basically you create a page, add some controls and the controls are not accessible in code behind.
After a bit of hunting I discovered a simple workaround – every time you create a ViewPage based ASPX file, right click on the project and click “Convert to Web Application”.
What this does is update the *.aspx.designer.cs/vb files that let you properly use codebehind.
This has been identified as a bug (here, but I can’t find the source of the bug identification, comments please!).
Advertisement


Thanks for this tip! There seem to be a couple of killer bugs in the MVC framework at the moment… Hopefully ironed out in the next release.
There’s no doubt the next release will be better… I think its fantastic they let us have a crack at new technologies like ASP.NET MVC so early in it’s design process!