Scott Spradlin

Developer Community Enthusiast

  Home  |   Contact  |   Syndication    |   Login
  21 Posts | 0 Stories | 9 Comments | 0 Trackbacks

News

Twitter












Tag Cloud


Archives

Post Categories

Friend's Blogs

SharePoint Blogs

So there I was -- another day of writing slick AJAXified custom SharePoint web parts.  This was a simple one.  A series of dropdowns that cause subsequent dropdowns to be re-populated with increasingly restrictive data.

  • Planet
  • Continent
  • Country
  • etc.

But, when I changed the planet choice to be "Earth" the continent choice DID populate with the continents on earth but it caused a complete page round trip -- not the smooth AJAXified action I expected.  Plus, my UpdateProgress panel wasn't being displayed at all, even though I put a 10 second pause in my event handler.  What's wrong?  I'm comparing my CreateChildControls against previous similar projects that worked in the past and everything appears to be correct.

Can't figure it out so I start randomly moving things around to see what effect that has.  (Highly technical debugging technique.)  I move a button up into the UpdatePanel and THAT WORKS!  It's the dropdown!  AJAX hates my dropdowns!

I start looking into why it's so.  Do I need to specify the <TRIGGER> manually for these controls?  Say it ain't so!  I've never had to do that in the past.  Wait, someone's post says "make sure you give your dynamically created controls an ID or AJAX won't work for them!"  I add a line similar to:

      MyDropdownControl.ID = "_AnIdHere_"

...and by golly now it works.  Moral of the story?  Always give your dynamically created controls a proper ID.  Just like Norm, web parts want to go -- wait for it -- where everybody knows their name.

Technorati Tags: ,,
posted on Thursday, July 10, 2008 7:49 PM

Feedback

# re: SharePoint Custom Web Parts from Cheers (The TV Show) 7/11/2008 6:03 AM bazztrap
was wondering if yo worked with Ajax webparts with custom tool part or editor part and being able to access those custom properties during your ajax call back

# re: SharePoint Custom Web Parts from Cheers (The TV Show) 7/11/2008 9:29 AM Scott Spradlin
I've not worked with that specific scenario. Do you have more details of what's wrong?

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 3 and 2 and type the answer here: