MVC IFrame Viewport Click Problem

  1. #1

    MVC IFrame Viewport Click Problem

    Hi I'm having a problem when I publish my MVC application to IIS6.

    When I run a local debug, everything runs flawlessly.

    But when I publish to an IIS server, when I click in the iframe, the entire frame goes 'gray'. If I click outside the iframe, the components reappear.

    I am using IE8 and IIS6 (windows 2003 with ASP applications enabled).

    Edit: Works fine in firefox - but our organization is IE only. Only developers get Firefox for debugging (firebug).

    Anyone have this issue before and/or know a solution?

    This is the simplest example that causes the error:
    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:ViewPort ID="ViewPort1" runat="server" Layout="fit">
            <Items>
                <ext:Panel runat="server" Title="Title" Height="400">
                </ext:Panel>
            </Items>
        </ext:ViewPort>
    </body>
    </html>
    Regards,
    Chris
    Last edited by ckarcz; Feb 29, 2012 at 1:46 AM. Reason: added firefox
  2. #2
    Hi,

    Could you provide an online sample to reproduce the problem?
  3. #3
    Hi Dan,

    I'm just opening a tab in my application based off the MVC example. Just like the CustomerAddressList report is opened, I instead open my own view. It has a viewport that I want to have a border layout.

    I open a tab using the same global js method addTab as in the MVC example.

    The page i'm loading into the tab's iframe contains a Viewport - I think the problem lies when I add a layout to the viewport.

    When I use this example for my page to add: https://examples1.ext.net/#/Layout/Fitlayout/Basic/

    I get the same problem. Here is a screenshot of when I click in the iframe (title bar dispears) and when I click away from the tab (reappears):

    Before click (good)
    Click image for larger version. 

Name:	2.JPG 
Views:	188 
Size:	11.7 KB 
ID:	3869

    Click in iframe (components disapear)
    Click image for larger version. 

Name:	1.JPG 
Views:	205 
Size:	10.8 KB 
ID:	3870
  4. #4
    EDIT: removed
    Last edited by ckarcz; Mar 02, 2012 at 12:37 AM.
  5. #5
    The only way I was able to get a border layout to appear is to set the viewport layout to fit and then create a panel or container that has the border layout.

    Same kind of error occurs if I click and drag - iframe goes gray/white. :/ Anyone know why?

    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Store ID="dsOrders" runat="server" RemoteSort="true">
        </ext:Store>
        <ext:Viewport runat="server" Layout="fit">
            <Items>
                <ext:Panel runat="server" Header="false" Border="false" Layout="BorderLayout">
                    <Items>
                        <ext:Panel runat="server" Title="Report Title" Region="Center"></ext:Panel>
                        <ext:Panel runat="server" Title="Report Title" Region="East" Width="250"></ext:Panel>
                    </Items>
                </ext:Panel>
            </Items>
        </ext:Viewport>
    </body>
    </html>
  6. #6
    I overcame the problem by not using a viewport and using a window that is maximized, no headers, with border layout and it works with no problems.
    Last edited by ckarcz; Mar 02, 2012 at 12:39 AM.
  7. #7
    Found a simple solution that allows me to render a Viewport in an iframe with no problems..



    Just add this:
    <input type="hidden" />
    I put it after the resource mgr and before the viewport. No rendering errors now.


    Part of a sample:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Sample.aspx.cs"
        Inherits="My.Namespace.Sample" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceMgr" runat="server" />
        <!-- hidden field required becauase IE sucks and won't render viewport correctly without it -->
        <input type="hidden" />   
        <ext:Viewport ID="MainWindow" runat="server" Layout="BorderLayout">
            <Content>
                <ext:Toolbar ID="MainToolbar" runat="server">
                    <Items>
    <!-- remainder omitted -->
  8. #8
    Hi,

    These work arounds should not be required.

    You're posting code samples that "work", but do not post a reproducible code sample that "doesn't work".
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 1
    Last Post: Mar 13, 2012, 8:37 AM
  2. viewport in iFrame or panel?
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: Dec 14, 2011, 1:58 PM
  3. [CLOSED] menu not automatically close if click the iframe
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 10, 2011, 5:57 AM
  4. Viewport and IFrame
    By dan182 in forum 1.x Help
    Replies: 6
    Last Post: Oct 20, 2011, 5:01 PM
  5. Help with ViewPort / Coolite Panel / IFrame
    By ljcorreia in forum 1.x Help
    Replies: 6
    Last Post: Jun 04, 2008, 3:20 PM

Tags for this Thread

Posting Permissions