[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Recurring problem w/ no solutions posted --- The name '__ctrl' does not exist in the class

(James Joyce)

12/25/2002 10:26:00 PM

Help,

I am having trouble creating a Custom Control, I've seen this same
problem posted three times but never any answer.

I am building a page called WebForm1.aspx to test a custom control
I am developing called PanViewer (inherits from
System.Web.UI.WebControls.WebControl). Everything will be working i.e.
The control compiles, shows up correctly in the IDE for the WebPage,
and displays properly when I view WebForm1.aspx.

Then at some point (I've started from scratch three times) I add
some code to the conrol and recompile it and it compiles fine and
shows up fine in the IDE for the WebPage but when I try to run the
page I get.

Compiler Error Message: CS0103: The name '__ctrl' does not
exist in the class
or namespace 'ASP.WebForm1_aspx'

Once I see this error I can't seem to get rid of it by removing the
new code or removing the
references, recompiling then re-adding the control.

Also no code I added at any time uses 'ctrl' or '__ctrl'. I am
assuming that somehow part of the System.Web.UI.Page is being shadowed
or something but I am totally stuck.


Thanks in advance

Jeremie
2 Answers

Ajay

12/17/2002 1:55:00 PM

0

Check the generated html being sent to browser after you have added your
code. Can you find any html element with id =__ctrl ?
Is it somehow related to your control rendering ?

Are you doing anything specific on your Control's render ?


"James Joyce" <I_am_James_Joyce@yahoo.com> wrote in message
news:2dec0c71.0212161101.285eaa38@posting.google.com...
> Help,
>
> I am having trouble creating a Custom Control, I've seen this same
> problem posted three times but never any answer.
>
> I am building a page called WebForm1.aspx to test a custom control
> I am developing called PanViewer (inherits from
> System.Web.UI.WebControls.WebControl). Everything will be working i.e.
> The control compiles, shows up correctly in the IDE for the WebPage,
> and displays properly when I view WebForm1.aspx.
>
> Then at some point (I've started from scratch three times) I add
> some code to the conrol and recompile it and it compiles fine and
> shows up fine in the IDE for the WebPage but when I try to run the
> page I get.
>
> Compiler Error Message: CS0103: The name '__ctrl' does not
> exist in the class
> or namespace 'ASP.WebForm1_aspx'
>
> Once I see this error I can't seem to get rid of it by removing the
> new code or removing the
> references, recompiling then re-adding the control.
>
> Also no code I added at any time uses 'ctrl' or '__ctrl'. I am
> assuming that somehow part of the System.Web.UI.Page is being shadowed
> or something but I am totally stuck.
>
>
> Thanks in advance
>
> Jeremie


(James Joyce)

12/25/2002 10:26:00 PM

0

Okay I figured out the probelem and the solution. It seems to be a bug
in VS/ASP.Net caused by naming the Namespace, Class and .cs file all
the same (PanViewer).
Changing the Namespace to something different (PanViewerLibrary) fixes
the problem. The IDE has no problem with this but ASP.Net seems to
choke.

I_am_James_Joyce@yahoo.com (James Joyce) wrote in message news:<2dec0c71.0212161101.285eaa38@posting.google.com>...
> Help,
>
> I am having trouble creating a Custom Control, I've seen this same
> problem posted three times but never any answer.
>
> I am building a page called WebForm1.aspx to test a custom control
> I am developing called PanViewer (inherits from
> System.Web.UI.WebControls.WebControl). Everything will be working i.e.
> The control compiles, shows up correctly in the IDE for the WebPage,
> and displays properly when I view WebForm1.aspx.
>
> Then at some point (I've started from scratch three times) I add
> some code to the conrol and recompile it and it compiles fine and
> shows up fine in the IDE for the WebPage but when I try to run the
> page I get.
>
> Compiler Error Message: CS0103: The name '__ctrl' does not
> exist in the class
> or namespace 'ASP.WebForm1_aspx'
>
> Once I see this error I can't seem to get rid of it by removing the
> new code or removing the
> references, recompiling then re-adding the control.
>
> Also no code I added at any time uses 'ctrl' or '__ctrl'. I am
> assuming that somehow part of the System.Web.UI.Page is being shadowed
> or something but I am totally stuck.
>
>
> Thanks in advance
>
> Jeremie