flnMichael
Programmer
Hey,
I have this piece of code in my codebehind (C#) for generating a tablecell with an image:
Now, I have another piece of code in the same codebehind. This is another textbox generation that has an onblur. The function does the right calculations and gets the right value at the end of the function, but I want the image to change. I may be doing the initial image generation wrong, with it being a new Hyperlink when I don't need it to be a hyperlink, I just wanted the image and that's the only way I could get it to show on the page.
Here's the function call:
and here's some of the function:
I guess all I want to know is how to get the image in a tablecell the right way, then pass it in the function and change it when the function is through.
Any help would be appreciated.
Thanks
Mike
I have this piece of code in my codebehind (C#) for generating a tablecell with an image:
Code:
TableCell PassFailImage = new TableCell();
HyperLink hlnk = new HyperLink();
hlnk.ID = "passfaillight" + max_parm_count.ToString();
hlnk.ImageUrl = "images/whiteball.gif";
hlnk.Controls.Add(hlnk);
PassFailImage.Controls.Add(hlnk);
Now, I have another piece of code in the same codebehind. This is another textbox generation that has an onblur. The function does the right calculations and gets the right value at the end of the function, but I want the image to change. I may be doing the initial image generation wrong, with it being a new Hyperlink when I don't need it to be a hyperlink, I just wanted the image and that's the only way I could get it to show on the page.
Here's the function call:
Code:
TableCell Value = new TableCell();
TextBox _Value = new TextBox();
_Value.Width = 80;
_Value.ID = "Value" + max_parm_count.ToString();
_Value.Attributes["onblur"] = "validate2(this.form, " + max_parm_count.ToString() + ", passfaillight" + max_parm_count.ToString() + ", " + max_parms + ");";
Value.Controls.Add(_Value);
and here's some of the function:
Code:
function validate2(form, index, passfail, max_parms)
{
pic = "images/whiteball.gif";
..
..
passfail.src = pic;
I guess all I want to know is how to get the image in a tablecell the right way, then pass it in the function and change it when the function is through.
Any help would be appreciated.
Thanks
Mike