Who is the true Asp.Net MVP here?

A

Amelyan

Can anyone explain *why* this happens (not how to work around it)?

An error has occurred because a control with auto-generated id '_ctl8' could
not be located to raise a postback event. To avoid this error, explicitly
set the ID property of controls that raise postback events.
 
C

clintonG

Simple and I'm not even a mind reader, an expert, or an MVP. You're using a
server control that can postback and it doesn't have a value for its ID
attribute. Provide the value and you can move on to other tasks. BTW -
responding to what may be sloppy programming or accidental ommission or
deletion of the value of the ID is not a work-around, it is a requirement of
the compiler that will create an ID as you have discovered.

You should learn how the page class events are processed and you will
hopefully understand how and why auto-generated ID's occur and why they are
needed. MSDN will help explain this.

--
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
 
A

Amelyan

I don't know, I think you do qualify for MVP :) Actually, every control that
postback has value set for ID. The thing is that it is an auto-generated id
(like "_ctl8"). So, I am wondering why ID set to _ctl8 (auto-generated)
would behave any differently from my explicitely set ID? I would like to
just explicitely set it and move on, but I want to understand why.

bwt, I am also from Milwaukee, what a coincidence...
 
H

Harolds

You are working in a disconnected type invirement, which means: though the
server generated the id, once it sends the page to the client it no longer
keeps track of that id.
 
C

clintonG

Generating IDs is a CLR black box process that is used for garbage
collection and other tasks. It is not unique to any 'mode' presumed or
documented as the serialized IDs are common to all compilation processes.

With regard to Web Forms, each instance of a page class is initialized by
the CLR, then each control in the class is initialized if it is CTS
compliant and so on. The CLR has to have some way of keeping order of all
the tasks the compilation process requires. It can be taken for granted
until there is a need to learn to read IL (Intermediate Language). That's
why we refer to many of these issues as black boxes. If you want to go artsy
fartsy we can all it abstraction.

I'm busy enough mastering application architecture, class design and
implementation and while I appreciate the accolades we can't nominate
ourselves as MVPs.

Amelyan, we should kick it around in email or IM?

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
 

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

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top