HELP! Error Loading ASPX : Object Reference not set to an instance object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pedro Correia

    #1

    HELP! Error Loading ASPX : Object Reference not set to an instance object

    Hello,

    When i run my aspx i get this weird error:

    System.NullRefe renceException: Object reference not set to an instance
    of an object.
    at emp.PAGTRF.Init ializeComponent ()
    at emp.PAGTRF.OnIn it(EventArgs e)
    at System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer )
    at System.Web.UI.P age.ProcessRequ estMain()

    On my localhost it works fine and it only fails in the production
    server.

    here it is the code of the initializecompo nent in the code-behind
    class:


    private void InitializeCompo nent()
    {

    this.lkb_contin uar.Click += new
    EventHandler(th is.lkb_continua r_Click);
    this.txtContinu ar.Click += new EventHandler(th is.lkb_continua r_Click);
    base.Load += new EventHandler(th is.Page_Load);
    this.ucContas1. DropConta.Selec tedIndexChanged += new
    EventHandler(th is.DropConta_Li stChanged);
    this.ddlDesc.Se lectedIndexChan ged += new
    EventHandler(th is.ddlDesc_List Changed);

    }

    all my controls are defined in my page with runat="server". And
    this.ucContas1. DropConta is defined as follows in a user control:

    public DropDownList DropConta
    {
    get {return ddlConta;}
    set {ddlConta = value;}
    }

    by the way ddlconta is a control (drop down list ) defined in my user
    control which works fine because it's being used in other pages.

    is there anyone with any idea about this one?

    thanks in advance

    Pedro Correia
Working...