By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,474 Members | 939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,474 IT Pros & Developers. It's quick & easy.

Rendering imageurl html

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Have you checked whether your aspx page is asp compatable?

Freddy
"Jeroen Klooster" <je************@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
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

Nov 18 '05 #2

P: n/a
you can not <%= %> inside a control tag. use the more restrictive <%# %>
-- bruce (sqlwork.com)
"Jeroen Klooster" <je************@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
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

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.