Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 13th, 2007, 06:33 AM
Registered User
 
Join Date: Dec 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default shopping cart-fly to basket in asp.net

hi all...
i am creating a shopping cart website. i want to implement product added to cart visually shown to user. i search this concept i got one javascript function. but i need to pass dynamic value to that function. my coding is as follows..

function addToBasket(productId){
if(!shopping_cart_div)shopping_cart_div = document.getElementById('shopping_cart');
if(!flyingDiv){
flyingDiv = document.createElement('DIV');
flyingDiv.style.position = 'absolute';
document.body.appendChild(flyingDiv);
}

shopping_cart_x = shoppingCart_getLeftPos(shopping_cart_div);
shopping_cart_y = shoppingCart_getTopPos(shopping_cart_div);

currentProductDiv = document.getElementById('slidingProduct' + productId);currentXPos = shoppingCart_getLeftPos(currentProductDiv);
currentYPos = shoppingCart_getTopPos(currentProductDiv);

diffX = shopping_cart_x - currentXPos;
diffY = shopping_cart_y - currentYPos;



var shoppingContentCopy = currentProductDiv.cloneNode(true);
shoppingContentCopy.id='';
flyingDiv.innerHTML = '';
flyingDiv.style.left = currentXPos + 'px';
flyingDiv.style.top = currentYPos + 'px';
flyingDiv.appendChild(shoppingContentCopy);
flyingDiv.style.display='block';
flyingDiv.style.width = currentProductDiv.offsetWidth + 'px';
flyToBasket(productId);

}
this is my asp.net code


<asp:DataList ID="dlstProductDetails" runat="server" RepeatDirection="Horizontal" RepeatColumns="3" HorizontalAlign="Center" style="text-align: center" Width="100%" SkinID="DataList" >
<ItemTemplate>
<div id="slidingProduct+dynamicvalue" class="sliding_product"><asp:ImageButton ID="imgbtnProductImage" runat="server" ImageUrl='<%#"images.aspx?id=" + Eval("ProductNo")%>' Height="100" Width="100" Commandname='<%#DataBinder.Eval(Container.DataItem , "ProductNo")%>' OnCommand="Filterdescription"/>
<br/>
<asp:Label ID="lblProductName" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "Productname")%>'></asp:Label>
<asp:Label ID="lblHyp" runat="server" text=" - " ForeColor="#ff8000"/>
<asp:Label ID="lblModelNo" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "ModelNo")%>'></asp:Label>
<br />
<asp:Label ID="lblrs" runat="server" text="RS." ForeColor="#ff8000"/>
<asp:Label ID="lblPrice" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SalesPrice")%>' ForeColor="#ff8000" ></asp:Label>
<asp:Label ID="Label1" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "ProductNo")%>'></asp:Label>

<br />
<a href="#" onclick="addToBasket(productno);return false;"><img src="images/basket.gif"></a>

</div>
</ItemTemplate>
</asp:DataList>

just see those functions. i need to pass dynamic value to addtobasket method and div id
 any one have any idea?

Reply With Quote
  #2 (permalink)  
Old December 18th, 2007, 07:31 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

The code is right there in front of you.

<%#DataBinder.Eval(Container.DataItem, "ProductNo")%>

This will give you the ProductNo for the particular row.

<div id="slidingProduct<%#DataBinder.Eval(Container.Dat aItem, "ProductNo")%>" class="sliding_product">

or

<a href="#" onclick="addToBasket('<%#DataBinder.Eval(Container .DataItem, "ProductNo")%>'); return false;">

/- Sam Judson : Wrox Technical Editor -/
Reply With Quote
The Following User Says Thank You to samjudson For This Useful Post:
Meisam.Kimiaei (August 1st, 2012)
  #3 (permalink)  
Old August 1st, 2012, 01:35 PM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Smile

hi friends
is source code this program?
if it is,sending...
Reply With Quote
  #4 (permalink)  
Old August 1st, 2012, 01:36 PM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Smile

hi friends
is source code this program?
if it is,sending...

Last edited by Meisam.Kimiaei; August 1st, 2012 at 01:38 PM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
persistent shopping basket and price changes andieje BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 May 3rd, 2009 12:12 PM
Please review open-source ASP.NET shopping cart nopCommerce ASP.NET 3.5 Professionals 0 October 31st, 2008 05:18 PM
migrate shopping cart from asp to asp.net aranjan ASP.NET 1.0 and 1.1 Professional 1 February 5th, 2007 04:30 PM



All times are GMT -4. The time now is 12:04 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.