Prev: Using an imagebutton and gridview checkbox colunm
Next: 2010 WebDeployment after build don't execute
From: bthumber on 25 Jun 2010 16:08 How do you made a reference to an image in the code behind? I'm trying to show a high priority "!" image if an "h" was in the label. Please the code below. view plaincopy to clipboardprint? private void ShowPriority() { StorePriority.Value = "n"; myLabel.Text = StorePriority.Value; if(myLabel.Equal("n"); { myLabel.Text = " "; } else { // How do reference the path to the image? }
From: Sarath Babu S on 8 Jul 2010 02:10
You have to use an asp:Image control, with ImageUrl property set to the priority icon file. You can then show and hide the image according to the priority. private void ShowPriority() { StorePriority.Value = "n"; myLabel.Text = StorePriority.Value; yourImage.ImageUrl = "...."; if(myLabel.Equal("n"); { myLabel.Text = " "; yourImage.Visible = false; } else { yourImage.Visible = true; } Sarath Babu S http://www.consultsarath.com "bthumber" <bthumber(a)discussions.microsoft.com> wrote in message news:C7F824BC-7D62-49E6-B7E1-953E4BAE1A71(a)microsoft.com... > How do you made a reference to an image in the code behind? I'm trying to > show a high priority "!" image if an "h" was in the label. Please the > code > below. > > view plaincopy to clipboardprint? > private void ShowPriority() > { > StorePriority.Value = "n"; > myLabel.Text = StorePriority.Value; > if(myLabel.Equal("n"); > { > myLabel.Text = " "; > } > else > { > // How do reference the path to the image? > } |