This is a migrated thread and some comments may be shown as answers.

Error Creating Control - <ControlName> Object reference not set to an instance of an object

3 Answers 162 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kellie
Top achievements
Rank 1
Kellie asked on 10 Dec 2010, 10:46 PM
I'm just posting a solution an error I was getting in Visual Studio 2010 as I couldn't seem to find a solution in the Telerik forums when searching. Forgive me if it's already posted.

When in Design mode all of my telerik controls on the page were showing the error "Error Creating Control - <ControlName> Object reference not set to an instance of an object"

I googled this error and found the 'workaround' solution at this link here.

You basically have to go to the OnInit event of your page (or of the class your page is inheriting from) and surround your init code with a check to see if it's not in DesignMode. Once you have surrounded your code with this check, you must close your pages and rebuild the project to make it work.

here's the code example:

protected override void OnInit(EventArgs e)
{
    if (!this.DesignMode)
    {
        //code here
    }
}

This is a bug with Visual Studio 2010 and not Telerik.

Hope this helps someone.
Kellie

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 11 Dec 2010, 10:55 AM
Hello Kellie,

Thank you for sharing your findings - thus you can help other Telerik community members who encounter the same design-time issue. Hopefully the VS 2010 SP1 release will address it. I updated your Telerik points for this post.

Best regards,
Sebastian
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Stephanie
Top achievements
Rank 1
answered on 28 Jan 2011, 02:54 AM
I had the same issue. Thanks for posting the solution.
0
Yudhishter
Top achievements
Rank 1
answered on 05 Feb 2016, 02:20 PM
It is because you are using .net visual studio  that is not latest and so you have to update application from one to latest.
If you open an  application in latest  studio from file menu not from copying files you  will be prompted a dialog box to update the application.Enjoy!!!!!! --------------Yudhishter Sukhija
Tags
General Discussions
Asked by
Kellie
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Stephanie
Top achievements
Rank 1
Yudhishter
Top achievements
Rank 1
Share this question
or