dcsimg
Results 1 to 4 of 4

Thread: Not sure of the syntax for an IFrame 'src' attribute?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,832

    Not sure of the syntax for an IFrame 'src' attribute?

    I have some markup code in which I have an IFrame. This IFrame needs to dynamically take a parameter in it's "src" attribute but I've tried doing it several ways and I keep getting an exception. Here is my code

    Code:
            <h3>Tool Edit</h3>
            <asp:UpdatePanel ID="UpdatePanel6" runat="server">
                <ContentTemplate>
                    <asp:Panel ID="pHeader6" runat="server" CssClass="cpHeader">
                        <asp:Label ID="lblText6" runat="server" Text="" />
                    </asp:Panel>
    
                    <asp:Panel ID="pBody6" runat="server" CssClass="cpBody">
                        <iframe id="documentFrame" src="Apps/ToolLists/ToolEdit.aspx?ToolID=<%# EVAL('FTN') %>" frameborder="0" width="100%" height="800px" runat="server">
                        </iframe>
                    </asp:Panel>
    
                    <ajaxToolkit:CollapsiblePanelExtender ID="CollapsiblePanelExtender6" runat="server" TargetControlID="pBody6" CollapseControlID="pHeader6" ExpandControlID="pHeader6"
                        Collapsed="true" TextLabelID="lblText1" CollapsedText="<i class='fa fa-plus'>" ExpandedText="<i class='fa fa-minus'>" CollapsedSize="0">
                    </ajaxToolkit:CollapsiblePanelExtender>
                </ContentTemplate>
            </asp:UpdatePanel>
    It doesn't like the highlighted code.

    Thanks,
    Blake

  2. #2
    Hyperactive Member
    Join Date
    Nov 2017
    Posts
    398

    Re: Not sure of the syntax for an IFrame 'src' attribute?

    If you remove the:

    Code:
    <%# EVAL('FTN') %>
    code and simply hard-code a valid ToolID manually for the purpose of testing, does it work? When I saw your code I had an immediate flashback to me trying to get something similar to work a long time ago using the <% blah %> method of inserting a value and having nothing but trouble with it. I'll see if I can find that code and what I ended up doing instead. No promises.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,832

    Re: Not sure of the syntax for an IFrame 'src' attribute?

    Yes...a hard-coded value does work. But then I realized it was a server control so I just accessed it in the code behind and that worked. But...I'm still curious why this didn't work?
    Blake

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,780

    Re: Not sure of the syntax for an IFrame 'src' attribute?

    If only there was a way that we could know what the exception was. Oh well, I guess that's impossible.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width