Wednesday, March 28, 2012

The clicking twice hair pulling doesnt do anything problem!

I have a single page in which everything is loaded from user controls based upon a specific value in the URL. The user controls are dynamically loaded (only load the user controls I need based upon the key in the URL). Within the user control is a form with a single button. When I click the button, nothing happens. When I click it again it does a full postback but all user controls are gone and I haven't the slightest idea if it upated or not. Now the form is in an update panel so it shouldn't be doing a post back.

To reiterate:

1. single page (call it default.aspx)
2. click a link with the key in the url (kind of like "?k=1048")
3. default.aspx runs through a case statement and find the key value that matches the URL then loads the user control.
4. user control has form on it
5. click the submit button, nothing happens. Click it again and it does a postback and all user controls are gone (AJAX didn't work).

So, any ideas about having to click twice and also why the update panel doesn't seem to be working?

thanks

^_^

ps. if i put the user control in a completely separate page where it isn't dynamically loaded, things work as intended.

To start with, when using Dynamic Controls, you should already know that you should RECREATE your controls on every page request. Keeping this in mind, you should keep track of which UserControl was loaded before and then reload it again!

Hope this helps,
Regards


That's nice but didn't help at all nor directed me to even an idea

What I did find was that when I removed the triggers from the update panel then the double-clicking went away and it operated as intended. but I wonder what will happen when I have multiple controls on a page that each have an update panel and I update one, will it cause the others to fire as well even with the mode set to conditional.

Does anyone have an idea of this cause that knows what they are talking about.

thanks

0 comments:

Post a Comment