views:

178

answers:

2

Hi,

Why do I get "Object Reference Not Set to Instance of an Object"

protected void GetData()
{
    ...

    id = this.GetTabControl().ID; //<---------here
}

...

protected ASPxPageControl GetTabControl()
{
    return (ASPxPageControl)this.FindControl("DetailTab");
}

---------I assume the FindControl is not working.

+3  A: 

Presumably because GetTabControl() is returning null. We can't tell why without more code though.

Jon Skeet
+1  A: 

GetTabControl() must be returning a null reference.

Raul Agrait