J
JimCinLA
Pardon. This question seems incredibly dumb but I seem to
be suffering a brain block. I want an ASP.Net 2.0 image control
to contain a variable for the image file name as shown...
<asp:Image runat="server" ID="myImage" ImageUrl = "<%=myImageFileName
%>" />
The variable myImageFileName is set in either the Page_Init or
Page_Load
event handler. The markup appears on a master page which is used
used by .aspx pages in different folders, and at different levels of
indirection with respect to the project root.
Is it that the script is being rendered before Page_Init?
Doesn't sound right. In fact, if I write
<td><% = myImageFileName %></td>
the file name shows up on the rendered page as expected.
I believe the previous image tag works if the feature is a client-
side
HTML tag. That is,
<img src="<%=myImageFileName %>" alt="" />
will *probably* produce the desired result. However, I have used an
active control because the path name in the file name contains the
"~" character, representing the project root which of course
is meaningless in an HTML tag.
be suffering a brain block. I want an ASP.Net 2.0 image control
to contain a variable for the image file name as shown...
<asp:Image runat="server" ID="myImage" ImageUrl = "<%=myImageFileName
%>" />
The variable myImageFileName is set in either the Page_Init or
Page_Load
event handler. The markup appears on a master page which is used
used by .aspx pages in different folders, and at different levels of
indirection with respect to the project root.
Is it that the script is being rendered before Page_Init?
Doesn't sound right. In fact, if I write
<td><% = myImageFileName %></td>
the file name shows up on the rendered page as expected.
I believe the previous image tag works if the feature is a client-
side
HTML tag. That is,
<img src="<%=myImageFileName %>" alt="" />
will *probably* produce the desired result. However, I have used an
active control because the path name in the file name contains the
"~" character, representing the project root which of course
is meaningless in an HTML tag.