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

Discussion in 'ASP .Net' started by Hadar, Sep 7, 2004.

  1. Hadar

    Hadar Guest

    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
     
    Hadar, Sep 7, 2004
    #1
    1. Advertising

  2. Hadar,

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

    Eliyahu

    "Hadar" <> wrote in message
    news:...
    > 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
    >
    >
     
    Eliyahu Goldin, Sep 7, 2004
    #2
    1. Advertising

  3. One more bracket:

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

    --
    Eliyahu

    "Eliyahu Goldin" <> wrote in message
    news:...
    > Hadar,
    >
    > Looks like you have a balagan with quotes. Try this:
    > src=<% = String.Format ("'{0}'", Request.QueryString.Get("content") %>
    >
    > Eliyahu
    >
    > "Hadar" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    >
     
    Eliyahu Goldin, Sep 7, 2004
    #3
  4. Hadar

    Hadar Guest

    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" <> wrote in message
    > news:...
    > > Hadar,
    > >
    > > Looks like you have a balagan with quotes. Try this:
    > > src=<% = String.Format ("'{0}'", Request.QueryString.Get("content") %>
    > >
    > > Eliyahu
    > >
    > > "Hadar" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
     
    Hadar, Sep 7, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page