Pass a variable value into a Button value c#

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2008
Posts: 9
Reputation: skaterz is an unknown quantity at this point 
Solved Threads: 0
skaterz skaterz is offline Offline
Newbie Poster

Pass a variable value into a Button value c#

 
0
  #1
Jan 28th, 2009
Hello..

I dont know where to start with my question.

I have a website that displays products (products retrieved from a database).

I use Datalist to display these products and this Datalist is linked to a Command in the C# code.

Within this datalist I have <itemtemplate> </itemtemplate> tags

Between the <itemtemplate> </itemtemplate> tags I have a Google 'Add to Cart' button as follows:

<div class="product"><input value="test" class="product-title" type="hidden"><input value="22.00" class="product-price" type="hidden"><div title="Add to cart" role="button" tabindex="0" class="googlecart-add-button"></div></div>



But what I want to do is replace the 22.00 input value with a Session Variable in my C# code. The session variable 'Session["Session_price"] will need to contain the price of the related product. So when the user clicks on the GOOGLE button that appears repeatetely because of the <itemtemplate> then I want to exececute a Command that will contain the code to connect to my database, retrieve the price of the related product and pass the price to the Google Button.


I have already a Command Argument in place for when the user clicks on a 'More Info' link that I also placed between the <itemtemplate> tags. When the user clicks on the 'More info' link it calls up a Command that contains a code that retrieves the description of the chosen product by filtering the Product Code.


I hope I make sense.

To summarize I want to modify the Google button (that is repeated due to the itemtemplate) as such so it gets the value of the price of a related product that also appears along with the Google Button in the <itemtemplate>.


Thank you in advance. Your help will help me save thousands of times.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Pass a variable value into a Button value c#

 
0
  #2
Jan 28th, 2009
I'd suggest you try the asp.net section.. They like web stuff there.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Pass a variable value into a Button value c#

 
0
  #3
Jan 28th, 2009
Exactly ASP.NET forum is better http://www.daniweb.com/forums/forum18.html
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 9
Reputation: skaterz is an unknown quantity at this point 
Solved Threads: 0
skaterz skaterz is offline Offline
Newbie Poster

Re: Pass a variable value into a Button value c#

 
0
  #4
Jan 28th, 2009
whoops, just noticed I'm in the wrong section

thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC