Click here to Skip to main content
15,888,218 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir...

My requirement is from list of checkboxes whene user click on checkbox the background color of these checkbox is changed.....
These is my code-
public string getWhileLoopData1()
{
List<int> list = new List<int>();
OleDbConnection cn = con.GetConnection();
string s2 = "Select id,seat_id from available_seat Where screen_no="+Lbl_screen_no.Text+" and seat_class='Gold' order by id";
cmd1 = new OleDbCommand(s2, cn);
OleDbDataReader dr1 = cmd1.ExecuteReader();
if (dr1.HasRows)
{
while (dr1.Read())
{
int count = Convert.ToInt32(dr1[0]);
list.Add(count);
}
}
string htmlStr = "";
for (int i = 0; i < list.Count; )
{
htmlStr += "<input type='checkbox' Id=" + list[i] + " name=' ' value=' '><input type='checkbox' Id=" + list[i + 1] + "     <input type='checkbox' Id=" + list[i + 2] + "<input type='checkbox' Id=" + list[i + 3] + "<input type='checkbox' Id=" + list[i + 4] + "<input type='checkbox' Id=" + list[i + 5] + "<input type='checkbox' Id=" + list[i + 6] + "<input type='checkbox' Id=" + list[i + 7] + "     <input type='checkbox' Id=" + list[i + 8] + "<input type='checkbox' Id=" + list[i + 9] + "";
C#
i = i + 10;
       }
       return htmlStr;
   }




plz help....
Posted
Comments
Raajkumar.b 6-Mar-14 0:49am    
refer this link
http://forums.asp.net/t/1510055.aspx

1 solution

 
Share this answer
 
Comments
Rajkumar_007 6-Mar-14 3:55am    
I know this, But How to use this javascript in for loop....
Rajkumar_007 6-Mar-14 3:58am    
for (int i = 0; i < list.Count; )
{
htmlStr += "<tr><td><input type='checkbox' Id=" + list[i] + " name=' ' value=' '> " + lststr[i] + "</td><td><input type='checkbox' Id=" + list[i + 1] + ">" + lststr[i + 1] + " </td><td>;
i = i + 10;
}
return htmlStr;


how to use this javascript in Above Code.........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900