CanvasFBMLMasterPage & gridview problems

Aug 27, 2008 at 3:54 AM

I am having some problems with the toolkit. I have an app thats using a master page dervied from CanvasFBMLMasterPage. When I add a gridview to my content page it tells me gridview must be contained within a <form runat="server"> however when I add that i get the error [HttpException (0x80004005): A page can have only one server-side Form tag.]. Does anyone know how to resolve this? The <form> tags are not on the master page or the content page, so I assume there is one on the canvasfbmlmaster. If that is the case how do i add the gridview?

Hope you all can understand what I'm asking.

Thanks and regards
Jan 9, 2009 at 5:06 PM
Did you ever find a solution to this problem?
Jan 23, 2009 at 6:31 AM
I was having the same problem, but I managed to figure out a fix.

In the CanvasFBMLMasterPage class, they render the page in the PreRender event handler. I have no idea why they do this. It makes no sense. But because they do it renders your form tag twice, which causes the error.

I worked around the problem by overriding the OnPreRender method in my master page class and *not* calling the method on the base class. This usually is a bad idea, and if you subscribe to the PreRender event later on it will never fire as you're effectively turning that event off, but aside from forking the toolkit I can't see any other way to do this.

I'm opening an issue for this problem, if only to get some explanation on why they want to render the page twice.
Feb 5, 2009 at 10:26 AM
Have you found any solution?