Here is one potential modified version of your code that should work, per Karl's suggestion.
protected void Page_Load(object sender, EventArgs e)
{
aginglabelvalue.Text = ((Label)FormView1.FindControl("aginglabel")).Text;
int num;
bool result = Int32.TryParse(aginglabelvalue.Text, out num);
if (result && num >= 0)
Image1.ImageUrl = "images/logo.png";
else
Image1.ImageUrl = "images/refresh.png";
}
- Brady My posts are kept as simple as possible for easier understanding. In many cases you can probably optimize or spruce up what I present. Have fun coding!
No comments:
Post a Comment