this.el is null, caused by <form runat=“server”>

  1. #1

    [FIXED] this.el is null, caused by <form runat=?server?>

    Original Post: http://stackoverflow.com/questions/5...m-runat-server
    Ok I'm stumped, I have a good 10 other pages all using the same layout etc all working fine, but I created a new page and cannot get it to work.

    I have noticed what is causing the error but I dont know why or how to fix it. Have a look at the code below,

    Its a form with runat server, Ext.Net Resource Manager, Viewport, Tab Panel and 2 Panels, no code behind.

    When I load this i get the dreaded this.el is null in Firefox and Uncaught TypeError: Cannot set property 'setSize' of null in Chrome. But alas I remove the form tag and everything works as it should. Now you might say well just remove the form tag, but I cant will add asp.net controls later that needs this tag.

    ASPX
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="PriceSetting.aspx.cs" Inherits="V2_RenewalsProcess_PriceSetting" %>
    
    <%@ 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 runat="server">
        <title>Ovott V2</title>
    </head>
    <body>
        <form id="pricesetting" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Viewport ID="Viewport1" runat="server" Layout="border">
                <Items>
                    <ext:TabPanel ID="TabPanel1" runat="server" Region="Center">
                        <Items>
                            <ext:Panel ID="Panel5" runat="server" Title="To Be Submitted" Border="false">
                            </ext:Panel>
                            <ext:Panel ID="Panel6" runat="server" Title="Awaiting Approval">
                            </ext:Panel>
                        </Items>
                    </ext:TabPanel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    Last edited by EugeneNiemand; Mar 11, 2011 at 9:08 AM.
  2. #2
    I couldn't reproduce the error. What version of ExtNet are you using? Also, are you sure there isn't something in the code behind that might be messing things up?
  3. #3
    I Just downloaded the current community version off Ext.Net website tested it again and the same thing is happening. There is no code behind at the moment.
  4. #4

    [FIXED]

    OK finally with the help of my colleague we solved this and it all came down to one character... a "!" and you might ask where?

    Original Code
    <DOCTYPE html PUBLIC "...
    Fixed Code
    <!DOCTYPE html PUBLIC "...
    Now it is working
  5. #5
    Yes, the '!' is required for a valid DOCTYPE. More information re: DOCTYPE's available from the following location, see

    http://www.w3schools.com/xhtml/xhtml_dtd.asp
    Geoffrey McGill
    Founder & CEO
  6. #6
    Quote Originally Posted by geoffrey.mcgill View Post
    Yes, the '!' is required for a valid DOCTYPE. More information re: DOCTYPE's available from the following location, see

    http://www.w3schools.com/xhtml/xhtml_dtd.asp
    I know that, but this was caused by some botched copy and paste effort by myself and I missed it. It is strange though that neither Visual Studio nor the browser complained about the invalid tag/declaration. It rendered regardless of the "!" but as soon as I added runat="server" it started giving Javascript errors that sent me on a wild goose chase.
  7. #7
    Quote Originally Posted by EugeneNiemand View Post
    I know that, but this was caused by some botched copy and paste effort by myself and I missed it. It is strange though that neither Visual Studio nor the browser complained about the invalid tag/declaration. It rendered regardless of the "!" but as soon as I added runat="server" it started giving Javascript errors that sent me on a wild goose chase.
    The browser probably just switched into Quirks Mode with no/improper DOCTYPE.
    Geoffrey McGill
    Founder & CEO

Similar Threads

  1. Replies: 16
    Last Post: Mar 08, 2012, 6:01 PM
  2. Replies: 0
    Last Post: Dec 02, 2011, 12:23 AM
  3. store or form turns null-strings into empty strings
    By hansweber2 in forum 1.x Help
    Replies: 0
    Last Post: Aug 25, 2009, 11:18 AM
  4. [CLOSED] Null Return from Ajax Form Result of Coolitve MVC
    By fondant in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 27, 2009, 10:02 PM
  5. [CLOSED] TableLayout Cell has no runat=server
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 29, 2009, 6:12 PM

Posting Permissions