| hi I have a datalist with som controls in it, one of them is check box, i want have a compare with two item(click 2 checkboxes, for comparing two product in my websit) so when checked two of them and user push compareBtn my codes go to another page with 2 valu (productId) how to do it |
Loading

Dhanunjay Jajimoggla100 reputationPosted May 31, 2014, 3:12 AM EDT
Whenever user checked two check boxes--->you have to maintain the Product Ids in session object.while loading another page, get the both product details from database with help of Product Ids and bind the particular data control.
Please provide the some more clarity.
See example : http://www.c-sharpcorner.com/uploadfile/syedshakeer/checkbox-in-gridview/
Best Regards,
Dhanunjay.
marjan gh12 reputationPosted May 31, 2014, 3:42 AM EDT
how can i access in datalist?
marjan gh12 reputationPosted May 31, 2014, 4:07 AM EDT
how can i use this sample
Dhanunjay Jajimoggla100 reputationPosted Jun 8, 2014, 9:21 PM EDT
marjan gh12 reputationPosted Jun 9, 2014, 8:44 PM EDT
i have a datalist that its content is my products
i put checkbox in it for checking 2 of them
so when checked 2 , i pass productId to another page
in next page i get productIds and show their feature
can u give me a sample?
Dhanunjay Jajimoggla100 reputationPosted Jun 9, 2014, 11:27 PM EDT
Follow below examples,
http://www.c-sharpcorner.com/uploadfile/bryianTan/Asp-Net-get-selected-checkbox-value-in-datalist/
Or
http://www.codeproject.com/Articles/206415/ASP-NET-Get-selected-checkbox-value-in-DataList
In this Examples you have to see how to get the Checked check box values in Datalist. So after geeting the Product Ids, same as below.
Whenever user checked two check boxes--->you have to maintain the Product Ids in session object or Pass through query string.while loading another page, get the both product details from database with help of Product Ids and bind the particular data control.
marjan gh12 reputationPosted Jun 9, 2014, 11:33 PM EDT
Dhanunjay Jajimoggla100 reputationPosted Jun 10, 2014, 12:48 AM EDT
Whenever user checked more than 2 check boxes,you will be display one Alert message.
marjan gh12 reputationPosted Jun 11, 2014, 3:48 AM EDT
Dhanunjay Jajimoggla100 reputationPosted Jun 12, 2014, 8:04 PM EDT
if(Count of checked boxes == 2)
{
Response.Write("alert('Please select Only two products')"); } else { //Write your logic here }