| | |
Pass a variable value into a Button value c#
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 9
Reputation:
Solved Threads: 0
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.
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.
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
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- execute behind the scene mysql update/insert query just on button click (PHP)
- Create a link in a table read from a CSV file and pass a variable (PHP)
- Couldn't pass variable values to another form (C++)
- Onclick to pass a variable to a PHP script (JavaScript / DHTML / AJAX)
- Need to Pass Variables from form to form (JavaScript / DHTML / AJAX)
- How to pass a whole table to another form? (Visual Basic 4 / 5 / 6)
- How do I pass values from a called form to a calling forms variables? (C++)
- Retaining radio button value during paging (ASP)
Other Threads in the C# Forum
- Previous Thread: Sending E-mail Using System.Web.Mail
- Next Thread: Double Click and Context Menu Error
| Thread Tools | Search this Thread |
.net access algorithm angle array barchart bitmap box broadcast c# capturing check checkbox client combobox control conversion convert csharp custom database datagrid datagridview dataset datetime dbconnection degrees delegate design development disappear draganddrop drawing encryption enum event excel file firefox form format forms function gdi+ httpwebrequest image index input install java label leak libraries list listbox mandelbrot math monodevelop mouseclick msword mysql operator path pause photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox round server sleep socket sql statistics stream string table tcpclientchannel text textbox thread time timer update usercontrol validation virtualization visualbasic visualstudio webbrowser windows winforms wpf xml






