Hi All.. (Be Gentle.. I'm new ) using C#.. below is my snippit of code..
I am Dynamically (While there a more .jpg's in a dir)
adding cells to a table with an image and a button
Question ..
How do I add a :
TableRow r = new TableRow();
for (int i = 0; i < numCells; i++) {
TableCell c = new TableCell();
if(count < numFiles){
label1.Text = "here 2";
fileName = files[count].ToString();
int LastIndex = fileName.LastIndexOf("\\");
fileName = fileName.Substring(LastIndex+1,(fileName.Length - LastIndex -1));
Image theImage = Make_Image(theDir + "/" + fileName);
Image theOtherImage = Make_OtherImage(theDir + "/" + fileName);
Button theButton = Make_Button(fileName);
c.Controls.Add(new LiteralControl("<div id='pic'><a href='#'>"));
c.Controls.Add(theImage);
c.Controls.Add(theOtherImage);
c.Controls.Add(new LiteralControl("</a></div>"));
c.Controls.Add(theButton);
}
r.Cells.Add(c); count++;
}
Table1.Rows.Add(r);
Loveuuz all....
Darren.
I am Dynamically (While there a more .jpg's in a dir)
adding cells to a table with an image and a button
Question ..
How do I add a :
- MouseOver/MouseOut event to the Image and a
- Clicked event to the Button
TableRow r = new TableRow();
for (int i = 0; i < numCells; i++) {
TableCell c = new TableCell();
if(count < numFiles){
label1.Text = "here 2";
fileName = files[count].ToString();
int LastIndex = fileName.LastIndexOf("\\");
fileName = fileName.Substring(LastIndex+1,(fileName.Length - LastIndex -1));
Image theImage = Make_Image(theDir + "/" + fileName);
Image theOtherImage = Make_OtherImage(theDir + "/" + fileName);
Button theButton = Make_Button(fileName);
c.Controls.Add(new LiteralControl("<div id='pic'><a href='#'>"));
c.Controls.Add(theImage);
c.Controls.Add(theOtherImage);
c.Controls.Add(new LiteralControl("</a></div>"));
c.Controls.Add(theButton);
}
r.Cells.Add(c); count++;
}
Table1.Rows.Add(r);
Loveuuz all....
Darren.