Skip to content Skip to sidebar Skip to footer

Td Background Picture Asp:image Possible?

I have a given asp.net site in which I change pictures as I need like Image1.ImageUrl = '~/Bilder/B1.png'; These pictures are in table cells as asp.Image. Is it possible to use the

Solution 1:

See the example below -

Front Page -

<!DOCTYPE html><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title></title></head><body><formid="form1"runat="server"><div><table><tr><td>Test</td><tdwidth="178"rowspan="3"background="<%= s_ImageUrl%>"></td></tr></table></div></form></body></html>

Code Behind -

PublicClass WebForm1
Inherits System.Web.UI.Page
Public s_ImageUrl AsStringProtectedSub Page_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load
    s_ImageUrl = "/image/test.jpg"EndSub

End Class

Now you can change the s_ImageUrl variable to change the image.

Post a Comment for "Td Background Picture Asp:image Possible?"