"Error Creating Control" on ASP.NET web form.

O

owen

Generally speaking, what does it mean when I see a "button" with red text
showing this message instead of the control I've dragged onto the web form
in Design View.? (But the page works fine at runtime). Does it indicate
a problem with References for example?

Thanks
Owen

PS. replies cc'd by email appreciated.
(e-mail address removed)
 
H

Herfried K. Wagner [MVP]

Hello,

owen said:
Generally speaking, what does it mean when I see a
"button" with red text showing this message instead of
the control I've dragged onto the web form in Design
View.? (But the page works fine at runtime). Does
it indicate a problem with References for example?

You may want to turn to the ng for ASP.NET Web Controls questions:

news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet.webcontrols

Web interface:

http://msdn.microsoft.com/newsgroup...ft.public.dotnet.framework.aspnet.webcontrols
PS. replies cc'd by email appreciated.

No.
 
C

Cor

Hi Owen,
First of all, if you next time have a message for this newsgroup, just ask
Error Creating Control on "VB.net" webform.

I don't know this message but I saw this on MSDN.

http://msdn.microsoft.com/library/d...html/vbtskaddingwebcontrolstowebformspage.asp

\\\
If the Web Forms Designer cannot render a Web server control correctly, it
displays a grey box with the text "Error Creating Control." This often means
that the ASP.NET syntax of the control is incorrect - for example, if the
runat="server" attribute is missing in a Web server control element, you
will see this error. Point to the information icon (); a ToolTip is
displayed with details about the error.
///
Do you see that ToolTip and a grey box (you said a red text, but I don't
know if it is in a grey box)

Let me know if you did find the sollution or has some more information about
the error?.

Cor
 
O

owen

Cor said:
Hi Owen,
First of all, if you next time have a message for this newsgroup, just ask
Error Creating Control on "VB.net" webform.

Sorry but I thought I did that? Perhaps I misunderstood your point, but I
did put "VB.NET" in the subject of my post. (note: I'm sorry if the
crosspost was inappropriate but I thought it was relevant to all those
newsgroups).
Do you see that ToolTip and a grey box (you said a red text, but I don't
know if it is in a grey box)

Yes, there was a grey box with red text and an "i" icon which had a tooltip.
The tooltip said something about "object reference is not an instance of an
object".
Let me know if you did find the sollution or has some more information about
the error?.

I found that it indicated a problem in the code underlying my control.
(which was a custom control based on a 3rd party Grid control). I
uninstalled and re-installed my 3rd party Grid control and this solved the
underlying problem in the code.... which removed the "Error Creating
Control" problem.

A search on Google newsgroups reveals that many people have been mystified
by "Error Creating Control".

It seems the main problem is the fact the error message is hidden inside a
tooltip, plus the fact it gives no indication of "where" the error occurrs.
It's so unhelpful, and the fact the project compiles perfectly just adds to
the mystery.

I now understand that certain things may work fine at Runtime but not at
Design time (for example if you use the Request object, which returns NULL
at design time). I would like to think MS will improve the way this is
handled in a future version of VS.NET so that it's clearer both what the
error is, and where it occurred. It would be better to show the error
itself instead of the insane "Error Creating Control", and perhaps make
clear when an error is a Design Time error *only*.

Owen
 
C

Cor

Owen,
Sorry but I thought I did that? Perhaps I misunderstood your point, but I
did put "VB.NET" in the subject of my post. (note: I'm sorry if the
crosspost was inappropriate but I thought it was relevant to all those
newsgroups).

It is not important, but I changed ASP.NET in VB.NET in the reply see your
original post.
ASP.NET seems sometimes a red sign in this newsgroup for "this is not for
us".
The tooltip said something about "object reference is not an instance of an
object".

That is of course important information
I found that it indicated a problem in the code underlying my control.
(which was a custom control based on a 3rd party Grid control). I
uninstalled and re-installed my 3rd party Grid control and this solved the
underlying problem in the code.... which removed the "Error Creating
Control" problem.
Cool

A search on Google newsgroups reveals that many people have been mystified
by "Error Creating Control".

I think webforms are in there childtime, yesterday I saw something strange
with code. It had to be done with HTML tags.
It would be better to show the error
itself instead of the insane "Error Creating Control", and perhaps make
clear when an error is a Design Time error *only*.
I do n't know if it helps for this, but an advice from someone active in
this newsgroup is set "Option Strict On" in the top of your code form.
And sometimes that helps you to find the error at design time (but your
problem is oposite I know).

But I am glad the problem is solved and that is the main thing.

Cor
 
Joined
Jul 3, 2006
Messages
1
Reaction score
0
Hi,

I implemented a pager custom control based on grid in ASP.NET 2.0/C#.At design time i am getting "Error creating control" Object refrence not set to an instance of an object error.But at runtime its working fine.Please let me know the solution.
Like Owen i dont have anything to install or uninstall.
Please let me know the solution asap.

Shash
 
Joined
Aug 19, 2010
Messages
1
Reaction score
0
Error Creating Control

-----------------------------------------------------------------
If you are not able to view your controls in the design page, try to follow the steps...

1. Right Click the Project
2. Click Convert to Web Application
3. It will ask to proceed the conversion from Web Project to Web Application.
4. Click Yes
5. Select "Clean Solution" from Build Menu
6. Select "ReBuild Solution" from Build Menu

I think this will help you...


KARTHICKREDDYK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top