answered question
0
Votes
Votes
2
Answers
Answers
M$3.00
How can I integrate a PayPal hosted shopping cart with my own site built in ASP.NET 2.0?
I built a simple web site for my small business in ASP.NET 2.0 using Visual Studio 2005, http://www.olisproducts.com and I'd like to integrate a simple PayPal shopping cart like these girls did (http://yummy-dummy.com/products.htm) but I'm having trouble because it seems that the PayPal code and the use of Master Pages in Visual Studio 2005 do not mix well. Something to do with the limitation of having only one tag at a time. The Master Page has a tag, and the PayPal code has a tag. Because of this, I get errors. That's about all I know.
I'm willing to accept a "here's a workaround" type answer if that's what it takes, but I'd like to have as solid of a ship as possible, of course. If there's a way to do it cleanly, I'd much rather do it that way.
Also (bonus points): for such a simple site as mine, is there any better software I could be using? Using Visual Studio 2005 seems a bit overkill for a site like mine, because it's not a web application. I had considered something like ZenCart but found it a pain to configure. Then I had considered Dreamweaver, but I don't know if it uses the Master Page concept that ASP.NET does, which makes it really convenient for me to create lots of pages with a consistent look and feel.
I'm willing to accept a "here's a workaround" type answer if that's what it takes, but I'd like to have as solid of a ship as possible, of course. If there's a way to do it cleanly, I'd much rather do it that way.
Also (bonus points): for such a simple site as mine, is there any better software I could be using? Using Visual Studio 2005 seems a bit overkill for a site like mine, because it's not a web application. I had considered something like ZenCart but found it a pain to configure. Then I had considered Dreamweaver, but I don't know if it uses the Master Page concept that ASP.NET does, which makes it really convenient for me to create lots of pages with a consistent look and feel.
answers (2)
Jeremy Schneider came up with a brilliant solution to this problem that consists of a custom HtmlForm class that can have the form tag rendering toggled on and off.
The class is called GhostForm and has a property, RenderFormTag. When RenderFormTag is set to false, it doesn't render the opening or closing tags, but does render all of the contents. Reference the custom GhostForm class and in the code-behind of the form on which you are placing the button, place the following in the Page_Load to disable the master page form tag:
public partial class Products : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
GhostForm mainForm = new GhostForm();
mainForm.RenderFormTag = false;
.....
}
// Send your data to PayPal :-)
.....
}
The class is called GhostForm and has a property, RenderFormTag. When RenderFormTag is set to false, it doesn't render the opening or closing tags, but does render all of the contents. Reference the custom GhostForm class and in the code-behind of the form on which you are placing the button, place the following in the Page_Load to disable the master page form tag:
public partial class Products : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
GhostForm mainForm = new GhostForm();
mainForm.RenderFormTag = false;
.....
}
// Send your data to PayPal :-)
.....
}
The cart at http://www.fatfreecart.com/ is as simple as you can possibly get. Just change the values to what you need and drop it in. it is made by the guys at http://www.e-junkie.com/ which would be the next step if you want a more managed cart, downloads, etc, but it is still just a drop-in solution. I use it at http://c-sharpener.com and it couldn't be easier to set up and requires absolutely no workarounds.
As for your second question, VS is a great program, but it can be a bit much some times. Microsoft offers a free Visual Web Developer Express which had it's newest version just released last year and will have more than all the features you need (you will recognize a lot from VS) including masterpage integration. Check it out: www.microsoft.com/express/vwd/
Good Luck!
As for your second question, VS is a great program, but it can be a bit much some times. Microsoft offers a free Visual Web Developer Express which had it's newest version just released last year and will have more than all the features you need (you will recognize a lot from VS) including masterpage integration. Check it out: www.microsoft.com/express/vwd/
Good Luck!
I can personally recommend e-junkie.
While I prefer code that is hosted on my server rather than rely on a 3rd party, I sometimes use e-junkie as a quick drop-in when I need to sell something very fast on a new page / site.
While I prefer code that is hosted on my server rather than rely on a 3rd party, I sometimes use e-junkie as a quick drop-in when I need to sell something very fast on a new page / site.
Related questions
140 characters left












