support multiple runat="server" forms in Web Forms pages
Allow for Web Forms pages to contain multiple server-side forms rather than just one. This allows for much better accessibility and usability in the pages.
6 comments
-
thorn commented
Peter, I know how the current implementation of UpdatePanel works. I'm talking about changing this. Yes, the issue is all about changing the mental model. Do you often care about controls outside the panel? As for me, generally, it's quite a rare case. For example, think of side bar widgets on a blog. Do they often need to know anything about the rest of the page in order to update properly?
-
Peter
commented
Thorn: The current UpdatePanel relies on there being a single form on the page. When you do a postback from an UpdatePanel all the state is sent back to the server, but only a portion is going back. This is why from an UpdatePanel event handler you can access the state of a web control that is outside the panel.
I'm not saying there's no way to do this, only that there's no way to do this with the current model. You'd have to take into consideration that some control that's in a different form would not get updated. The current mental model in WebForms apps is that all controls are in sync. With multiple forms you would have to bend that "rule".
-
thorn commented
Peter, each form can be placed in its own UpdatePanel. I believe this issue should be consolidated with this one: http://aspnet.uservoice.com/forums/41202-asp-net-web-forms/suggestions/2059147-better-updatepanel-true-ajax
-
Peter
commented
If my understanding of how WebForms works is correct, this feature is not possible. The reason there can only be one form on the page is that the server-side controls need the browser state information (what people typed in the form) in order to rebuild their control state. With multiple forms, only the state within those forms is sent back to the server, so on the server-side the web controls would lose data. As a workaround one would have to rely on Javascript to either do the posting or gather the rest of the state from the other forms on the page for a post; which would defeat the intended purpose.
-
Mohamed Meligy commented
I don't see this one when I filter to webforms sub-category http://aspnet.uservoice.com/forums/41202-asp-net-webforms , could that be why it's not taking enough look / consideration? Could any of the moderators make it show under this category?
-
John
commented
Adding this feature to Web Forms would be enormously beneficial in so many ways. It would make a HUGE difference when developing a modular system, such as a CMS. The single runat form restriction, for me, is the single most frustrating thing about Web Forms.