[CLOSED] Problem with code working in ExtJS with htm file, but not in aspx file

  1. #1

    [CLOSED] Problem with code working in ExtJS with htm file, but not in aspx file



    I've got a very small example I attached of three files that all include the same JavaScript file (a.js).


    The htm file works without error, however both the aspx files (one using coolite, the other calling ExtJS directly) both fail with the same error (see png file inside zip file for error).


    Is there something fundamentally with what I'm doing in the a.js file?


    Thanks

    BTW, here is the zip file with the problem code. I can not upload because it says I have exceeded some limit.
    http://peterkellner.net/misc/AspNetExtJSProblem.zip

  2. #2

    RE: [CLOSED] Problem with code working in ExtJS with htm file, but not in aspx file

    Hi Peter,

    The issue with the sample is that your handrolled Ext.FormPanel is being added to the Page inside the <form runat="server">. That then adds a <form> within a <form>, which the script is choking on.

    If you want to add the Ext.FormPanel, the location it's rendered to must be placed outside the <form runat="server">, or you could also change to the an Ext.Panel.

    The following code sample demonstrates a modified version of the .aspx Page and .js file.

    Example

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" 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 runat="server">
        <title>Mixed Coolite + ExtJS</title>
        
        <ext:ScriptContainer runat="server" />
        <script src="A.js" type="text/javascript"></script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" Theme="Gray" />
    
            <div id="mydiv">
    
            
            <ext:Window 
                ID="Window1" 
                runat="server" 
                Title="Success" 
                Icon="Accept" 
                Html="This Page is properly configured!" 
                BodyStyle="padding:6px;"
                />
        </form>
        
        <!-- If Ext.FormPanel, then must render outside of form -->
        <div id="mydiv2">
    
        
    </body>
    </html>
    Example

    Ext.BLANK_IMAGE_URL = '../ExtJS/resources/images/default/s.gif';
    
    Ext.onReady(function() {
        var simpleForm = new Ext.Panel({
            region : 'north',
            height : 80,
            labelWidth : 75, // label settings here cascade
            frame : true,
            title : 'Simple Form',
            width : 350,
            defaults : {
                width : 230
            },
            defaultType : 'textfield',
            items : [{
                fieldLabel : 'First Name',
                name : 'first'
            }]
        });
    
        var myContentIdWidth = 700;
        
        var panel = new Ext.Panel({
            title : '',
            layout : 'border',
            width : myContentIdWidth,
            height : 500,
            items : [simpleForm, {
                    title : 'Main Content',
                    height : 300,
                    region : 'center',
                    margins : '5 5 0 0'
                }]
    
            });
        
        panel.render('mydiv');
    });
    Hope this helps.

    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] Problem with code working in ExtJS with htm file, but not in aspx file

    perfect, thanks.

    (any way to make my uploads work again?)
  4. #4

    RE: [CLOSED] Problem with code working in ExtJS with htm file, but not in aspx file

    Hi Peter,

    I jacked up the forum upload limit. Should be lots of space now.*


    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] resource manager and limiting extjs file size
    By craig2005 in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Oct 03, 2013, 9:41 AM
  2. Replies: 0
    Last Post: Apr 19, 2012, 4:32 PM
  3. Replies: 4
    Last Post: Mar 29, 2012, 3:36 PM
  4. Load Tab from aspx file - Gridpanel Layout
    By Romans in forum 1.x Help
    Replies: 1
    Last Post: Nov 30, 2009, 9:08 AM
  5. Call aspx file directly from the desktop
    By Amorim in forum 1.x Help
    Replies: 0
    Last Post: Jul 13, 2009, 8:19 AM

Posting Permissions