4 Attachment(s)
[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
Code:
<%@ 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
Script Error using open Popup page
Quote:
Originally Posted by
Daniil
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.
Script Error using open Popup page
Quote:
Originally Posted by
Daniil
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.