Rendering imageurl html

  • Thread starter Thread starter Jeroen Klooster
  • Start date Start date
J

Jeroen Klooster

Hi all!

I'm having some trouble using user controls.

Situation:

An apsx page contains an user control (Control A) that contains
another user control(Control B). Control B is located in the subfolder
"Controls" and has some imagebutton server controls. I want to set the
imageurl of these image controls directly into the html using:

<code>

<ASP:IMAGEBUTTON runat="server" id="btnTest"
imageurl='<%=Session["imgprefix"]%>images/test.gif'/>

</code>

the html output from .NET :

<code>

<input type="image" name="ctrlA:ctrlB:btnTest"
id="ctrlA_ctrlB_DownButton"
src="Controls/<%=Session[&quot;imgPrefix&quot;]%>images/test.gif"
align="Middle" border="0" />

</code>

Anybody has a clue why the src attribute is rendered like this?

Thanks in advance,
Jeroen
 
you can not <%= %> inside a control tag. use the more restrictive <%# %>


-- bruce (sqlwork.com)
 
Back
Top