472,347 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,347 software developers and data experts.

Shopping cart -fly to basket in asp.net and dhtml

hi all. now i m creating shopping cart. i would like to make when the user click the add to basket button, item added visually shown to user. i found one script for this in net.. but i couldnt pass dynamic productid to that addtobasket javascript function.
this is my function..
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... pls modify this code for my requirement... thanks...
Dec 17 '07 #1
0 1742

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Don Grover | last post by:
I am retrieving costs and product id's from a sql db. and need to build a shopping cart around it. How do I store the selected items and qty req so...
1
by: madison | last post by:
Hi, I am trying to start a website using paypals shopping cart function. If i have 10 items and they sell out, how do I make it so the item is...
1
by: Jia Sun | last post by:
hello , everybody , i need a similar program , just like fancyimport.com if possible, pls contact me ,thank you very much . inchina@gmail.com
1
by: Adil Akram | last post by:
I have created a site shopping cart in ASP.net. I am using ASP session object's SessionID on non SSL connection to track session. While adding...
2
by: G.E.M.P | last post by:
High Level Session Handling Design for a Shopping cart 0) What am I missing? 1) How does OSCommerce do it? I'm thinking about building a...
7
by: isaac2004 | last post by:
hi i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping...
1
by: jecha | last post by:
I'm implementing a shopping cart but am having a problem in checking out a person who has added item in his/her shopping busket.The code for the...
15
gregerly
by: gregerly | last post by:
Hello, I once again turn to this community of genius' for some help with a problem. I've got a shopping cart (which is working well so far) that...
3
by: Paulo | last post by:
Hi, beginner on asp.net 2.0 C# VS 2005, how can I use the shopping cart concept on my application? When the user clicks add item, it will be stored...
6
by: frank | last post by:
can anyone point me to a free shopping-cart script?
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.