Solved

Master page and HTML FORM tag?

Posted on 2006-11-29
6
1,755 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 125 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 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