vpatel2708
asked on
asp.listview and paypal problem
I am trying to use the asp:listview to add products to a page.
I have managed to get them all the page.
But when I add the <form...etc for the paypal button, the first element in the list seems to render as its own list.
I view source and the source only has one <ul> body, so I am bit stuck as to what is happening,
I ahve tried changing the <ul><li> to tables instead but I still get the same problem.
Please help
I have managed to get them all the page.
But when I add the <form...etc for the paypal button, the first element in the list seems to render as its own list.
I view source and the source only has one <ul> body, so I am bit stuck as to what is happening,
I ahve tried changing the <ul><li> to tables instead but I still get the same problem.
Please help
<asp:listview id="pics" runat="server"
ondatabinding="pics_DataBinding" onitemdatabound="pics_ItemDataBound" >
<layouttemplate>
<ul class="picList">
<placeholder id="itemPlaceholder" runat="server" />
</ul>
</layouttemplate>
<itemtemplate>
<li>
<img src="Photos/<%#Eval("PhotoName")%>.jpg" alt=""/>
<form name="ppform" id="ppform" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="<%#Eval("PhotoName")%>"></input>
<input type="hidden" name="cmd" value="_cart"></input>
<input type="hidden" name="business" value="inf0@vnayer.com"></input>
<input type="hidden" name="item_name" value="VNayer Photography"></input>
<input type="hidden" name="item_number" value="<%#Eval("PhotoName")%>"></input>
<input type="hidden" name="no_shipping" value="0"></input>
<input type="hidden" name="no_note" value="1"></input>
<input type="hidden" name="on0" value=""></input>
<input type="hidden" name="return" value="http://www.vnayerphotography.com/default.aspx"></input>
<input type="hidden" name="currency_code" value="GBP"></input>
<input type="hidden" name="lc" value="UK"></input>
<input type="hidden" name="bn" value="PP-ShopCartBF"></input>
<input type="hidden" name="shipping" value="0.00"></input>
<input type="hidden" name="flatRateShipping" value="true"></input>
<input type="hidden" name="flatShippingCost" value="0.00"></input>
<input type="hidden" name="localPickup" value="false"></input>
<select name="amount" id="sizes">
<option value="35">10x8 Print - £35.00</option>
<option value="12.50">7x5 Print - £12.50</option>
<option value="5.50">6x4 Print - £5.50</option>
</select>
<br />
<input type="image" src="../images/shoppingcart.gif" name="submit" style="padding:0px;margin-bottom:-2px;" alt="PayPal!"></input>
</form>
</li>
</itemtemplate>
<emptydatatemplate>
<div>
Sorry - no photos found
</div>
</emptydatatemplate>
</asp:listview>
vnayersnip.JPG
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks DaTribe...
Would you just put this onto the click event of your add to cart button then?
Would you just put this onto the click event of your add to cart button then?
Probably just the product code or something that would identify what product they chose. Depending on how the site allows users to list prices in various currencies that might have to be sent also.
DaTribe
DaTribe
ASKER
Still a little lost in the execution of the thing as a whole.
So let me start by what I am thinking.
In the markup, <ItemTemplate> I would have my image as it is, then a dropdownlist to show the options that are available to buy and an add to cart button, this button when clicked would need to tell serverside the product chosen and the option in the dropdownlist chosen.
On sever side I can then construct the URL and redirect to that url?? is that right?
Also would be great if you could post a small sample of what the Navigator class looks like...cheers
So let me start by what I am thinking.
In the markup, <ItemTemplate> I would have my image as it is, then a dropdownlist to show the options that are available to buy and an add to cart button, this button when clicked would need to tell serverside the product chosen and the option in the dropdownlist chosen.
On sever side I can then construct the URL and redirect to that url?? is that right?
Also would be great if you could post a small sample of what the Navigator class looks like...cheers
OK await a sample code snippet. Since I left all my resources at home I would have to reconstruct.
DaTribe
DaTribe
ASKER
Thank you for your help, its really appreciated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for the delayed respose.
Thank you so much for the sample project, I didn't use your exact example, but your help definetly pointed me in the right direction and now I have my own shopping cart.
;-}
Thank you so much for the sample project, I didn't use your exact example, but your help definetly pointed me in the right direction and now I have my own shopping cart.
;-}
ASKER
Very grateful for the trouble you went through to provide me a sample solution
Always glad to help!
DaTribe