473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

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

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
Nov 18 '05 #1
3 17723
Hadar,

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

Eliyahu

"Hadar" <cr****@bezeqint.net> wrote in message
news:uB*************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2
One more bracket:

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

--
Eliyahu

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
Hadar,

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

Eliyahu

"Hadar" <cr****@bezeqint.net> wrote in message
news:uB*************@TK2MSFTNGP12.phx.gbl...
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


Nov 18 '05 #3
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
One more bracket:

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

--
Eliyahu

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
Hadar,

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

Eliyahu

"Hadar" <cr****@bezeqint.net> wrote in message
news:uB*************@TK2MSFTNGP12.phx.gbl...
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



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeff Dockman | last post by:
Background: We needed the ability to create a templated web site that may change in layout from installation to installation. To accomplish this, we created a base Page class that all pages in...
5
by: Jeremy Ames | last post by:
I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because...
2
by: Axel Dahmen | last post by:
HI, I want to dynamically add controls to a web page from within a common base class. Unfortunately, ASP.NET fails with "System.Web.HttpException: The Controls collection cannot be modified...
3
by: thomasamillergoogle | last post by:
Is it possible that my user control can add code to the HEAD of the parent page that hosts the control?
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
0
by: Dan | last post by:
Hi, I get this error: "Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). " when trying to create a table in the code-behind file like this: dim...
0
by: Zimmergren | last post by:
I know this has been up on googlegroups before, on several places. However, I havn't found a solution to this specific problem. I get this errormessage: "The Controls collection cannot be...
2
by: CyberSoftHari | last post by:
I am adding dynamic controls in my page through a panel as figured below. pnlModel.ID = "pnlDyModel"; pnlModel.Controls.Add(lblReportTitle); pnlModel.Controls.Add(new...
1
by: Radu | last post by:
Hi. I am trying to localize a page AND simulate the AJAX watermarks in it, i.e. the textbox contains the text "Enter your name", or "Entrez votre nom", for instance, then on click, delete this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.