Properties can be toggled on and off in the ImageButton click event noting
I'm writing the following on the fly...
// C#
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if(ImageButton1.ImageUrl == "~/Images/ShowPanel.gif")
{
myPanel.Visible = true;
ImageButton1.ImageUrl = "~/Images/HidePanel.gif";
}
else
{
myPanel.Visible = false;
ImageButton1.ImageUrl = "~/Images/ShowPanel.gif";
}
}
// VB
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As
ImageClickEventArgs)
If ImageButton1.ImageUrl = "~/Images/ShowPanel.gif" Then
myPanel.Visible = True
ImageButton1.ImageUrl = "~/Images/HidePanel.gif"
Else
myPanel.Visible = False
ImageButton1.ImageUrl = "~/Images/ShowPanel.gif"
End If
End Sub
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL
http://metromilwaukee.com/
URL
http://clintongallagher.metromilwaukee.com/
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello,
I have an image button in a web page.
The default image is ShowPanel.gif.
When the image is clicked I want the panel "myPanel" to become visible and
the image button to change to HidePanel.gif.
When the image is clicked again now the panel becomes invisible and the
image gets back to ShowPanel.gif.
I have been playing with commandname, commandargument and oncommand
properties but I haven't been able to make this work.
Can someone help me out?
Thanks,
Miguel