PC Review


Reply
Thread Tools Rate Thread

who can explain?

 
 
AlexS
Guest
Posts: n/a
 
      1st Sep 2003
Here is the problem:

An error has occurred because a control with auto-generated id '_ctl2' could
not be located to raise a postback event. To avoid this error, explicitly
set the ID property of controls that raise postback events.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: An error has occurred because a
control with auto-generated id '_ctl2' could not be located to raise a
postback event. To avoid this error, explicitly set the ID property of
controls that raise postback events.

Source Error:


An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:


[HttpException (0x80004005): An error has occurred because a control with
auto-generated id '_ctl2' could not be located to raise a postback event. To
avoid this error, explicitly set the ID property of controls that raise
postback events.]
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean
fBeforeLoad) +851
System.Web.UI.Page.ProcessRequestMain() +878





----------------------------------------------------------------------------
----

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573

What is the proper way to correct this? I found one solution, which looks
stupid enough:

related control, before adding it to Controls collection of page should be
assigned specific ID string,

maycontrol=new Web.UI.Controls.ImageButton();
mycontrol.ID="myid";
this.Controls.Add(mycontrol);

Then this exception disappears.

But bewilderment doesn't!!!!!


 
Reply With Quote
 
 
 
 
Stephen
Guest
Posts: n/a
 
      1st Sep 2003
I'm not familiar with COM, but it looks like it wants you
to explicitly set the <Assembly: Guid("")> attribute that
is in the AssemblyInfo.vb (in VB) file that is auto-
generated with a new project. I guess auto-generated
GUIDs aren't good enough for objects that are exposed to
COM in the unlikely event that there will be a
duplicate. Hope that helps.

Stephen

>-----Original Message-----
>Here is the problem:
>
>An error has occurred because a control with auto-

generated id '_ctl2' could
>not be located to raise a postback event. To avoid this

error, explicitly
>set the ID property of controls that raise postback

events.
>Description: An unhandled exception occurred during the

execution of the
>current web request. Please review the stack trace for

more information
>about the error and where it originated in the code.
>
>Exception Details: System.Web.HttpException: An error

has occurred because a
>control with auto-generated id '_ctl2' could not be

located to raise a
>postback event. To avoid this error, explicitly set the

ID property of
>controls that raise postback events.
>
>Source Error:
>
>
> An unhandled exception was generated during the

execution of the
>current web request. Information regarding the origin

and location of the
>exception can be identified using the exception stack

trace below.
>
>
>Stack Trace:
>
>
>[HttpException (0x80004005): An error has occurred

because a control with
>auto-generated id '_ctl2' could not be located to raise

a postback event. To
>avoid this error, explicitly set the ID property of

controls that raise
>postback events.]
> System.Web.UI.Page.ProcessPostData

(NameValueCollection postData, Boolean
>fBeforeLoad) +851
> System.Web.UI.Page.ProcessRequestMain() +878
>
>
>
>
>
>---------------------------------------------------------

-------------------
>----
>
>Version Information: Microsoft .NET Framework

Version:1.1.4322.573; ASP.NET
>Version:1.1.4322.573
>
>What is the proper way to correct this? I found one

solution, which looks
>stupid enough:
>
>related control, before adding it to Controls collection

of page should be
>assigned specific ID string,
>
>maycontrol=new Web.UI.Controls.ImageButton();
>mycontrol.ID="myid";
>this.Controls.Add(mycontrol);
>
>Then this exception disappears.
>
>But bewilderment doesn't!!!!!
>
>
>.
>

 
Reply With Quote
 
Joe White
Guest
Posts: n/a
 
      1st Sep 2003
You'll have better luck in a Web Forms newsgroup.


AlexS wrote:
> Here is the problem:
>
> An error has occurred because a control with auto-generated id '_ctl2' could
> not be located to raise a postback event. To avoid this error, explicitly
> set the ID property of controls that raise postback events.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.Web.HttpException: An error has occurred because a
> control with auto-generated id '_ctl2' could not be located to raise a
> postback event. To avoid this error, explicitly set the ID property of
> controls that raise postback events.
>
> Source Error:
>
>
> An unhandled exception was generated during the execution of the
> current web request. Information regarding the origin and location of the
> exception can be identified using the exception stack trace below.
>
>
> Stack Trace:
>
>
> [HttpException (0x80004005): An error has occurred because a control with
> auto-generated id '_ctl2' could not be located to raise a postback event. To
> avoid this error, explicitly set the ID property of controls that raise
> postback events.]
> System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean
> fBeforeLoad) +851
> System.Web.UI.Page.ProcessRequestMain() +878
>
>
>
>
>
> ----------------------------------------------------------------------------
> ----
>
> Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
> Version:1.1.4322.573
>
> What is the proper way to correct this? I found one solution, which looks
> stupid enough:
>
> related control, before adding it to Controls collection of page should be
> assigned specific ID string,
>
> maycontrol=new Web.UI.Controls.ImageButton();
> mycontrol.ID="myid";
> this.Controls.Add(mycontrol);
>
> Then this exception disappears.
>
> But bewilderment doesn't!!!!!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
please explain sunilpatel Microsoft Excel Programming 1 1st May 2009 08:58 PM
How do you explain Ant Windows XP New Users 19 27th Oct 2005 06:37 PM
Re: How do you explain Robert Aldwinckle Microsoft Word New Users 6 27th Oct 2005 06:51 AM
can someone explain.... =?Utf-8?B?VE9NIFAu?= Microsoft Windows 2000 RAS Routing 1 26th Jul 2004 02:32 PM
Can Someone explain this? bill lechner Microsoft Windows 2000 CMD Promt 2 30th Jun 2003 04:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:11 PM.