Login  
Search All Forums
Dart Home | PowerWEB LiveControls for ASP.NET | Custom Development Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
AuthorForum: PowerWEB LiveControls for ASP.NET
Topic: porblem with live image
bhupinder

From: Nuernberg, Germany
Posts: 14
Member Since: 06/22/06
posted July 5, 2007 8:30 AM

I want to change imageurl of a liveimage control on command event of a livebutton.The code works as it should it comes to the point where i change the url but the change is not visible. The image is not being changed.

 <Live:LiveButton ID="btnTest" runat="server" Text="Test" CausesValidation="false" />

<Live:LiveImage ID="imgShow" runat="server" />

CODE-BEHIND
-------------

Protected Sub btnTest_Command(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles btnTest.Command
    If imgShow.ImageUrl.ToString.Contains("online") Then
      imgShow.ImageUrl = "../Images/icons/icon_online_n.gif"
    Else
      imgShow.ImageUrl = "../Images/icons/icon_komme_n.gif"
    End If
  End Sub


Thanks
bhupinder

From: Nuernberg, Germany
Posts: 14
Member Since: 06/22/06
posted July 5, 2007 8:32 AM

i have tried it with "~/Images/icons/icon_online_n.gif", same result.Image is not being changed.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 5, 2007 5:47 PM

Hi,
When I do the following:

protected void LiveButton1_Click(object sender, EventArgs e)
{
  if (LiveImage1.ImageUrl == "images/1.jpg")
    LiveImage1.ImageUrl = "images/2.jpg";
  else
    LiveImage1.ImageUrl = "images/1.jpg";
}

It works for me.
If I include the "~/" it stops working.

Does this work for you?
Thanks,
-ken
bhupinder

From: Nuernberg, Germany
Posts: 14
Member Since: 06/22/06
posted July 9, 2007 3:10 AM

yes it works for me.thanks
Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX