Developing Matt

My Technical Journal

Your need for control doesn’t exist on this page

leave a comment »

I have a control named THERE_IS_NO_REASON_FOR_YOUR_NEED_FOR_CONTROL  and in my update panel named GERMS_ARE_EVERWHERE I have a trigger pointing to this control.  It should work.  The more you sanitize, the fewer bugs….in theory.  Apparently not in my code.

So today I received the error “a control with id of THERE_IS_NO_REASON_FOR_YOUR_NEED_FOR_CONTROL  could not be found for the trigger in updatepanel GERMS_ARE_EVERWHERE

EASY ONE.  I figured this one out all on my own with out any help.**

You see, your control can’t find your trigger, most likely because you spent too much time designing your page and placed it in another pretty control of some kind.  For me, I put it in an infragistics group box, but you could have placed it any number of places. 

So the easy way out is to add code in the form_load routine for your trigger.  Assign your trigger to the unique id of your control and let the page work out it’s own details.  :

   Dim trig As New AsyncPostBackTrigger
   trig.ControlID = YourButton.UniqueID
   trig.EventName = "Click"
   UpdatePanel1.Triggers.Add(trig)

 

So the next time you want to obsess about the germs remember in reality your need to control them is futile.  For it will never find all of them.  They say that immunizations (code-behind) helps.  And well, I guess the bugs are gone for now so we can rest for a bit.

-Matt

–=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

**  Not true.  I looked on the WORLD WIDE WEB and found a post by PJDEV who led me to the light.  Thanks Paul Juenger.  I suppose you could have found PJDEV’s post yourself but I thought adding to the solution would be better than your incessant online digging and wasting of time. 

Advertisements

Written by matt

July 20, 2011 at 5:30 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: