The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)

H

Hadar

Hi,

I'm trying to dynamically set the src of an iframe with the <% %> block:
<iframe id="content" src="<% = Request.QueryString.Get("content") %>"
width="100%"></iframe>

Notice that the tag (intentionally) has no runat=server and also nested in a
<TD> tag...

What am I doing wrong?

Thanks,
Hadar
 
E

Eliyahu Goldin

Hadar,

Looks like you have a balagan with quotes. Try this:
src=<% = String.Format ("'{0}'", Request.QueryString.Get("content") %>

Eliyahu
 
E

Eliyahu Goldin

One more bracket:

src=<% = String.Format ("'{0}'", Request.QueryString.Get("content")) %>
 
H

Hadar

Hi Eliyahu,

Thanks for your reply.
I tried what you suggested, and still it doesn't work (same error).
I guess it's not the quotes...

Any other suggestions?

Hadar
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top