?
Solved

Master page and HTML FORM tag?

Posted on 2006-11-29
6
Medium Priority
?
1,757 Views
Last Modified: 2010-08-05
How can I use an HTML FORM tag on a content page that uses a Master page?  The HTML FORM is now inside the Master page serverside FORM.  I need to use the HTML FORM on a few pages.

Specifically: I have one page with multiple PayPal "Add to cart" images.  Each image is inside of a FORM.  This is code that comes from PayPal.  So how can I do that with one FORM tag (Master page's FORM)?  

The page has an "Add to cart" for each different product.  Each product one uses a different URL.

Thanks,
Brett
0
Comment
Question by:brettr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:stengelj
ID: 18042642
You can add this to your page directive on every page that you need to add an HTML FORM: EnableEventValidation="false"

Or,

You can apply this setting to all of your web pages by  adding this to the system.web section of your web.config file:
<pages validateRequest="false" enableEventValidation="false" />

Before you do this, make sure you understand and are okay with impact this could have on your security.  

See: http://msdn2.microsoft.com/en-us/library/system.web.ui.page.enableeventvalidation.aspx

That should work.

0
 

Author Comment

by:brettr
ID: 18042954
Thanks.  This is close to working.  However, the first FORM doesn't work.  It still references the current URL, which just references the current page.  But all FORMs after on that same page are fine.  So I put an empty FORM first:

<form></form>

and I'm good to go.  Any idea why that is?
0
 
LVL 9

Accepted Solution

by:
stengelj earned 500 total points
ID: 18043039
I haven't used master pages extensively yet, but I have run into situations like this where pages under the master, or web user controls inside a master, need to see a control before it will recognize it.  I don't know why this is or if there is a real fix for this issue, but I usually get around it by loading a "dummy" instance of a control on the master page.  I'm kind of surprised to see this happen with a plain HTML element, but the concept is the same.

Add your dummy <form></form> right after the <form> tag on the master page.  At least then you won't have to do it on all of your other pages.

If someone else could shed some light on this little oddity, that would be great.  Personally, I think there are still some glitches to work out with master pages.  There is supposed to be a service pack coming out for VS soon.  Maybe that will take care of the issue.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:brettr
ID: 18043076
I'll use the dummy <form> tags on specific pages, since I still use the master's <form> tag in some cases.

Thanks.
0
 
LVL 9

Expert Comment

by:stengelj
ID: 18043215
You should be able to have the dummy <form>on the master and still be able to use the "official" master's <form> tag.  The runat="server" should trump the dummy <form> tag for any of your server-side stuff, but I can understand wanting to keep the workarounds on their respective pages.

Thanks for the points and good luck with your project!
0
 

Author Comment

by:brettr
ID: 18046171
You're welcome.  I've put up another post you might be interested in: http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_22077883.html.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question