[CLOSED] Script Error using open Popup page

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Script Error using open Popup page

    Hi,

    we have created new sample pages and reproduce the script error when open the popup page. There are two pages
    Page1.aspx,
    Page1.aspx.cs,
    Page2.aspx
    
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test1.aspx.cs" Inherits="Test1" %>   <!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 runat="server">     <title></title> </head> <body>     <ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">     </ext:ResourceManager>     <form id="form1" runat="server">     <ext:Viewport ID="ViewPort1" runat="server" StyleSpec="background-color: transparent;"         Layout="FitLayout">         <Content>             <ext:Container ID="Container1" runat="server" Layout="BorderLayout">                 <Items>                     <ext:Panel ID="pnlNorth" runat="server" Height="75" Border="false" Header="false"                         BodyStyle="background-color: transparent;" Region="North">                         <Content>                             North section <a href='#' id='new_communication' onclick='Open_communication()' ext:qtip='Open Comment'>                                 Communication</a>                         </Content>                     </ext:Panel>                     <ext:Panel runat="server" Width="165" ID="pnlSettings" BodyStyle="background-color: #284051;"                         Region="West">                         <Content>                             West Section                         </Content>                     </ext:Panel>                     <ext:TabPanel ID="tpPortal" runat="server" Title="TabPanel" Border="false" EnableTabScroll="true"                         BodyStyle="background-color: transparent;" Region="Center">                         <Items>                             <ext:Panel ID="Tab1" Title="Header Tab" runat="server">                                 <Items>                                     <ext:TabPanel ID="TabPanel1" runat="server" IFrameMaskMsg="Load..." AutoScroll="false"                                         Border="false" BodyStyle="background-color: #427298;" TabPosition="top">                                         <Items>                                             <ext:Panel ID="Panel1" runat="server" Title="Panel1">                                             </ext:Panel>                                             <ext:Panel ID="Tab5" runat="server" BodyStyle="background:white" Title="Panel5">                                             </ext:Panel>                                             <ext:Panel ID="Tab2" runat="server" BodyStyle="background:white" Title="Panel2">                                             </ext:Panel>                                             <ext:Panel ID="Tab3" runat="server" BodyStyle="background:white" Title="Panel3">                                             </ext:Panel>                                             <ext:Panel ID="Tab4" runat="server" BodyStyle="background:white" Title="Panel4">                                             </ext:Panel>                                         </Items>                                     </ext:TabPanel>                                 </Items>                             </ext:Panel>                         </Items>                         <Listeners>                         </Listeners>                     </ext:TabPanel>                 </Items>             </ext:Container>         </Content>     </ext:Viewport>     <ext:Button ID="btn_communication" runat="server" Hidden="true">         <DirectEvents>             <Click Delay="1" OnEvent="communicationopen" ShowWarningOnFailure="false" Timeout="120000">             </Click>         </DirectEvents>     </ext:Button>     <script type="text/javascript">           function Open_communication() {             btn_communication.fireEvent("click");         }           function GetPopupDimension() {             var size = Ext.getBody().getSize();             var popupres = new Object();             popupres.height = size.height * 0.9; //h             var maxscrper = 0.70;             var minscrper = 0.98;             var scrbyte = (screen.width - 1024) / 16;             var scrper = (scrbyte * 0.0115);             var scrpercons = minscrper - scrper;               if (parseFloat(scrpercons).toFixed(2) <= maxscrper) scrpercons = maxscrper;             popupres.width = (screen.width + 10) * scrpercons; //w             return popupres;         }           function IsDynamicSizePopupPage(pageName) {             return true;         }           function OpenCommentPage(windowId, page, w, h, t) {             var isExist = Ext.isEmpty(Ext.getCmp(windowId));             if (isExist == true) {                   var size = GetPopupDimension();                   if (page.indexOf("?") >= 0)                     page = page + "&ht=";                 else                     page = page + "?ht=";                   page = page + size.height.toString() + "&wt=" + size.width.toString();                   if (IsDynamicSizePopupPage(page)) {                     w = size.width;                     h = size.height;                 }                   var load = "Loading";                 win1 = new Ext.Window({                     modal: false,                     layout: 'absolute',                     width: w,                     height: h,                     title: t,                     closable: true,                     closeAction: 'destroy',                     resizable: false,                     loader: {                         loadMask:                         {                             showMask: true, msg: load                         },                         scripts: true, mode: "frame", url: page, autoLoad: true                     },                     autoScroll: false,                     collapsible: true,                     id: windowId                 });                 win1.width = w;                 win1.height = h;                 win1.show();             }             else {                 var isshown = Ext.getCmp(windowId).isVisible();                 if (isshown == false) {                     win1.show();                 }             }         }       </script>     </form> </body> </html> 
    
    
    
    using System; using System.Collections.Generic; using System.Linq; using  System.Web; using System.Web.UI; using System.Web.UI.WebControls; using  Ext.Net;   public partial class Test1 : System.Web.UI.Page {      protected void Page_Load(object sender, EventArgs e)     {       }        protected void communicationopen(object sender, DirectEventArgs e)     {          string pageName = "Test2.aspx";            this.ScriptManager1.AddScript("OpenCommentPage(\u0022c2\u0022, \u0022 " +  pageName + "\u0022, 980,600, \u0022Communication\u0022);");     } }
    
    
    <%@ Page Language="C#" AutoEventWireup="true" %>   <!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 runat="server">      <title></title> </head> <body>      <ext:ResourceManager ID="ScriptManager1" runat="server"  StateProvider="None" Namespace="">     </ext:ResourceManager>      <form id="form1" runat="server">     <ext:Viewport  ID="ViewPort1" runat="server" Layout="FitLayout"  StyleSpec="background-color: red;">         <Content>              <ext:Container Layout="BorderLayout" ID="BorderLayout1"  runat="server" Width="500"                 Height="500">                  <Items>                     <ext:Panel ID="Panel1"  runat="server" Border="false" Width="500" Height="295" Region="North"                          StyleSpec="bgcolor:red;">                          <Content>                             Header                          </Content>                     </ext:Panel>                  </Items>             </ext:Container>          </Content>     </ext:Viewport>     </form>  </body> </html>

    We are getting more script errors when open the page2.aspx.

    Please find the attachment
    Attached Thumbnails Click image for larger version. 

Name:	Errors.jpg 
Views:	16 
Size:	97.2 KB 
ID:	6989  
    Attached Files
    Last edited by Daniil; Oct 11, 2013 at 4:36 AM. Reason: [CLOSED]
  2. #2
    Hi @speedstepmem4,

    Could you, please, edit the post? I mean the code samples. It is in one line.
  3. #3

    Script Error using open Popup page

    Quote Originally Posted by Daniil View Post
    Hi @speedstepmem4,

    Could you, please, edit the post? I mean the code samples. It is in one line.
    I did edit the sample content. Please check and give your feedback.
  4. #4
    Sorry, but it doesn't look better.
  5. #5

    Script Error using open Popup page

    Quote Originally Posted by Daniil View Post
    Sorry, but it doesn't look better.
    Now I've attached the Sample Source as Text file attachment . Please verify this and provide your solution ASAP

    I would like to know like Is it possible attach zip file.
    What is the best way to provide the samples?

    Thanks.
    Last edited by speedstepmem4; Oct 04, 2013 at 7:44 AM.
  6. #6
    Quote Originally Posted by speedstepmem4 View Post
    Now I've attached the Sample Source as Text file attachment . Please verify this and provide the solution.

    I would like to know like Is it possible attach zip file.
    What is the best way to provide the samples?

    Thanks.
    We are waiting for your solution. Please provide the solution.
    Last edited by speedstepmem4; Oct 05, 2013 at 4:29 AM.
  7. #7
    Is there any chance you can edit the initial post to get the code formatted like in the example below?

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "test1", "test2", "test3" },
                    new object[] { "test4", "test5", "test6" },
                    new object[] { "test7", "test8", "test9" }
                };
            }
        }
    </script>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server">
                <Store>
                    <ext:Store runat="server">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="test1" />
                                    <ext:ModelField Name="test2" />
                                    <ext:ModelField Name="test3" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column runat="server" Text="Test1" DataIndex="test1" />
                        <ext:Column runat="server" Text="Test2" DataIndex="test2" />
                        <ext:Column runat="server" Text="Test3" DataIndex="test3" />
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>
    There should be no need in any attachments.

    Please read #3 here:
    http://forums.ext.net/showthread.php?10205
  8. #8
    Please edit the code samples in your first post to provide proper code formatting. We cannot copy+paste your samples.

    Please place each simplified sample within their own individual [CODE] block.

    More information regarding posting in the forums and providing code samples is provided in the Forum Guidelines, see

    http://forums.ext.net/showthread.php?3440-Forum-Guidelines-For-Posting-New-Topics

    The following also provides some extra forum posting tips and tricks, see

    http://forums.ext.net/showthread.php?10205-More-Information-Required
    Geoffrey McGill
    Founder
  9. #9

    Page1.aspx

    Hi,
    Please find the below code block for your reference.

    <%@ Page Language="C#" %>
     
    <script runat="server">
        protected void communicationopen(object sender, DirectEventArgs e)
        {
            string pageName = "Test2.aspx";
    
    
            this.ScriptManager1.AddScript("OpenCommentPage('c2','" + pageName + "', 980,600, 'Communication');");
        }
    </script>
     
    <!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="ScriptManager1" runat="server" StateProvider="None" Namespace="">
        </ext:ResourceManager>
        <form id="form1" runat="server">
        <ext:Viewport ID="ViewPort1" runat="server" StyleSpec="background-color: transparent;"
            Layout="FitLayout">
            <Content>
                <ext:Container ID="Container1" runat="server" Layout="BorderLayout">
                    <Items>
                        <ext:Panel ID="pnlNorth" runat="server" Height="75" Border="false" Header="false"
                            BodyStyle="background-color: transparent;" Region="North">
                            <Content>
                                North section <a href='#' id='new_communication' onclick='Open_communication()' ext:qtip='Open Comment'>
                                    Communication</a>
                            </Content>
                        </ext:Panel>
                        <ext:Panel runat="server" Width="165" ID="pnlSettings" BodyStyle="background-color: #284051;"
                            Region="West">
                            <Content>
                                West Section
                            </Content>
                        </ext:Panel>
                        <ext:TabPanel ID="tpPortal" runat="server" Title="TabPanel" Border="false" EnableTabScroll="true"
                            BodyStyle="background-color: transparent;" Region="Center">
                            <Items>
                                <ext:Panel ID="Tab1" Title="Header Tab" runat="server">
                                    <Items>
                                        <ext:TabPanel ID="TabPanel1" runat="server" IFrameMaskMsg="Load..." AutoScroll="false"
                                            Border="false" BodyStyle="background-color: #427298;" TabPosition="top">
                                            <Items>
                                                <ext:Panel ID="Panel1" runat="server" Title="Panel1">
                                                </ext:Panel>
                                                <ext:Panel ID="Tab5" runat="server" BodyStyle="background:white" Title="Panel5">
                                                </ext:Panel>
                                                <ext:Panel ID="Tab2" runat="server" BodyStyle="background:white" Title="Panel2">
                                                </ext:Panel>
                                                <ext:Panel ID="Tab3" runat="server" BodyStyle="background:white" Title="Panel3">
                                                </ext:Panel>
                                                <ext:Panel ID="Tab4" runat="server" BodyStyle="background:white" Title="Panel4">
                                                </ext:Panel>
                                            </Items>
                                        </ext:TabPanel>
                                    </Items>
                                </ext:Panel>
                            </Items>
                            <Listeners>
                            </Listeners>
                        </ext:TabPanel>
                    </Items>
                </ext:Container>
            </Content>
        </ext:Viewport>
        <ext:Button ID="btn_communication" runat="server" Hidden="true">
            <DirectEvents>
                <Click Delay="1" OnEvent="communicationopen" ShowWarningOnFailure="false" Timeout="120000">
                </Click>
            </DirectEvents>
        </ext:Button>
        <script type="text/javascript">
     
     
            function Open_communication() {
                btn_communication.fireEvent("click");
            }
     
     
            function GetPopupDimension() {
                var size = Ext.getBody().getSize();
                var popupres = new Object();
                popupres.height = size.height * 0.9; //h
                var maxscrper = 0.70;
                var minscrper = 0.98;
                var scrbyte = (screen.width - 1024) / 16;
                var scrper = (scrbyte * 0.0115);
                var scrpercons = minscrper - scrper;
     
     
                if (parseFloat(scrpercons).toFixed(2) <= maxscrper) scrpercons = maxscrper;
                popupres.width = (screen.width + 10) * scrpercons; //w
                return popupres;
            }
     
     
            function IsDynamicSizePopupPage(pageName) {
                return true;
            }
     
     
            function OpenCommentPage(windowId, page, w, h, t) {
                var isExist = Ext.isEmpty(Ext.getCmp(windowId));
                if (isExist == true) {
     
     
                    var size = GetPopupDimension();
     
     
                    if (page.indexOf("?") >= 0)
                        page = page + "&ht=";
                    else
                        page = page + "?ht=";
     
     
                    page = page + size.height.toString() + "&wt=" + size.width.toString();
     
     
                    if (IsDynamicSizePopupPage(page)) {
                        w = size.width;
                        h = size.height;
                    }
     
     
                    var load = "Loading";
                    win1 = new Ext.Window({
                        modal: false,
                        layout: 'absolute',
                        width: w,
                        height: h,
                        title: t,
                        closable: true,
                        closeAction: 'destroy',
                        resizable: false,
                        loader: {
                            loadMask:
                            {
                                showMask: true, msg: load
                            },
                            scripts: true, mode: "frame", url: page, autoLoad: true
                        },
                        autoScroll: false,
                        collapsible: true,
                        id: windowId
                    });
                    win1.width = w;
                    win1.height = h;
                    win1.show();
                }
                else {
                    var isshown = Ext.getCmp(windowId).isVisible();
                    if (isshown == false) {
                        win1.show();
                    }
                }
            }
     
     
        </script>
        </form>
    </body>
    </html>
    Page2.aspx
    <%@ Page Language="C#" AutoEventWireup="true" %>
     
     
    <!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="ScriptManager1" runat="server" StateProvider="None" Namespace="">
        </ext:ResourceManager>
        <form id="form1" runat="server">
        <ext:Viewport ID="ViewPort1" runat="server" Layout="FitLayout" StyleSpec="background-color: red;">
            <Content>
                <ext:Container Layout="BorderLayout" ID="BorderLayout1" runat="server" Width="500"
                    Height="500">
                    <Content>
                        <ext:Panel ID="Panel1" runat="server" Border="false" Width="500" Height="295" Region="North"
                            StyleSpec="bgcolor:red;">
                            <Content>
                                Header
                            </Content>
                        </ext:Panel>
                    </Content>
                </ext:Container>
            </Content>
        </ext:Viewport>
        </form>
    </body>
    </html>
    Last edited by Daniil; Oct 07, 2013 at 4:52 AM. Reason: All code in one post
  10. #10
    Thank you. Now code formatting is OK.

    Though, a few issues. This Geoffrey's phrase:
    Please place each simplified sample within their own individual [CODE] block.
    He didn't mean "post" under "block". In this case it is better to place all the code blocks into the only post.

    Also it is better to place the code behind direct to the ASPX page wrapping in:
    <script runat="server">
    
    </script>
    I followed my own suggestions just to demonstrate you. So, please review the post #9, i.e. a previous one.

    Now we can start investigating an issue.

    I launched the things in FireFox, IE8, IE9 and didn't see any errors.

    So, do you see the error just after page loading or some steps are required?

    Also I am testing with the SVN trunk. What Ext.NET version are you testing with?
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Script error on page with tooltip and master page
    By sisa in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 26, 2013, 2:45 PM
  2. [CLOSED] Open a modal popup from a modal popup
    By Aparna_B in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 24, 2012, 8:58 AM
  3. Replies: 1
    Last Post: Feb 03, 2012, 2:36 PM
  4. [CLOSED] popup open as topmost
    By Marcelo in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 03, 2011, 6:58 PM
  5. Replies: 2
    Last Post: Jul 29, 2009, 1:57 PM

Tags for this Thread

Posting Permissions