Multiple <?ASPNET_FORM> on a page? Options
Deirh
Posted: Saturday, July 26, 2008 12:40:34 AM
Rank: Newbie

Joined: 7/17/2008
Posts: 13
Location: Prague
Hi,
how can I have two or more user controls, both using a form, on one page so that they don't quarrel together? I'm aiming at a MemberLogin control and an AutoForm/Doc2Form control.

As I understand it, they have to both be until the <?ASPNET_FORM> tag. Now, if I do that and encapsulate all with this tag, their submit buttons then quarrel together and one influences the other. A member for example cannot log out, cause it's interpretted also as posting the AutoForm.

If I try to make two separate <?ASPNET_FORM> for each of them, it simply does not work, only the first one is parsed. Anyone got a solution for this? Thank you!
mschuler
Posted: Saturday, July 26, 2008 1:32:03 AM
Rank: Newbie

Joined: 7/25/2008
Posts: 2
Location: switzerland
Hi deirh

I have the <?ASPNET_FORM> Tag in the main template and don't use form-tags in the controls.
drobar
Posted: Saturday, July 26, 2008 4:56:12 AM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,689
Location: KY, USA
You can't have a form within a form. But you can have multiple forms as long as each is self-contained. Just open the form around the macro, then close it before opening another form for the second macro.

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
neehouse
Posted: Sunday, July 27, 2008 2:40:48 AM

Rank: Umbracoholic

Joined: 7/20/2006
Posts: 1,074
Location: Charleston, West Virginia, United States
Ahh... Client Side validation getting you! Any thoughts?

• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
neehouse
Posted: Sunday, July 27, 2008 2:58:32 AM

Rank: Umbracoholic

Joined: 7/20/2006
Posts: 1,074
Location: Charleston, West Virginia, United States
You should be able to disable the validation on the logout button for the member controls.

Edit the control's ascx and add the following to the logout button's tag:

CausesValidation="False"

Case

• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
Deirh
Posted: Sunday, August 24, 2008 1:00:14 AM
Rank: Newbie

Joined: 7/17/2008
Posts: 13
Location: Prague
Can you please elaborate?

If I put everything under one form in the master page, the Logout button does nothing. Tried adding what you proposed into
Code:
<asp:LinkButton id="LinkButtonLogout" runat="server" CausesValidation="False">

and it didn't seem to change anything.

Does this mean I cannot put two form-using controls together on one page? ie. Member Register Form together with Member Login on the top of the page?
Skiltz
Posted: Sunday, August 24, 2008 1:07:07 AM

Rank: Devotee

Joined: 12/6/2007
Posts: 61
You can definetly have mutiple "form-using" controls together on one page. You could look into using validation group. http://msdn.microsoft.com/en-us/library/ms227424.aspx. i.e group all your member controls into one validation group.



New Zealand Umbracoee
Deirh
Posted: Monday, September 01, 2008 12:26:24 AM
Rank: Newbie

Joined: 7/17/2008
Posts: 13
Location: Prague
Thanks for the link, I will study it asap :)
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.