Forum Moderators: open
<script runat="server">
Sub Page_Load (Sender as Object, E as EventArgs)
dim rootPath as String
dim Backgrd as String
rootPath = "C:\Inetpub\wwwroot\"
FileName.ImageUrl= rootPath &("noe.jpg")
Backgrd= rootPath &("bakladyynew.jpg")
end sub
</script>
<html>
<head>
</head>
<body background="Backgrd" topmargin="0">
<form runat="server">
<asp:Image id="Filename" runat="server"></asp:Image>
</form>
</body>
</html>
the Jpg image"neo.jpg appears. value got through
->FileName.ImageUrl= .
but the ->Backgrd= does not seem to work! I cant pass the values from the server side to the html side
why? If creating my own web controls will make this whole thing easier can someone tell me how to do that? thanks.
I know for text its lbmessage.text
images is image.ImageUrl
but If I claim a variable like ->Backgrd how do I pass that value to the html side.
hope Im clear enough.
On the HTML of the ASPX Page. As you coded.
<body bgcolor="<%=BackGrd%>">
then on the .vb codebehind.......
Public BackGrd As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BackGrd = "green"
End Sub
You will need to compile the project for the .vb code to run.
BackGrd = "C:\Inetpub\wwwroot\bakImage.jpg"
server side and
<body background="<%=BackGrd%>">
html side )
I cant beleive it. It's the first time that I participate in a forum and this is realy a great way
to find solutions to coding problems.
I guess I have to learn more about asp.net thanks to all of ya!