Rendering imageurl html

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
 
B

bruce barker

you can not <%= %> inside a control tag. use the more restrictive <%# %>


-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top