Showing posts with label radiobutton. Show all posts
Showing posts with label radiobutton. Show all posts

Saturday, March 24, 2012

UpdatePanel and a listbox

I have an UpdatePanel wrapping a RadioButton control and a ListBox control; depending on which RadioButton is selected, I'll also have either another ListBox control or a TextBox control displayed within the UpdatePanel. All of that works fine. Depending on what the user selects in the first DropDown control, I'm populating another ListBox control outside the UpdatePanel with either Carriers, Members or Providers; that part also works fine, but then I hit a snag. Even though the ListBox outside of the UpdatePanel gets populated, none of the items are displayed unless the entire page is posted back to the server ... something which I'm trying to avoid. Is there any other way to force the ListBox to display those items without performing a postback for the entire page?

I'm reasonably sure that that listbox has to be in an updatepanel to get the behavior you're looking for.


paul.vencill:

I'm reasonably sure that that listbox has to be in an updatepanel to get the behavior you're looking for.

Paul,

I ended up putting the listbox to be populated with either Carriers, Members or Providers into a separate UpdatePanel as you suggested and it works great now. Thanks for the tip! Wink

Allen


Glad I could help

Wednesday, March 21, 2012

UpdatePanel and RadioButtons

I have a series of RadioButton controls, each with a unique ID, each set to AutoPostBack, followed by an UpdatePanel with a set of event triggers, one for each RadioButton control, aimed at the "CheckedChanged" event. The RadioButton controls all belong to the same group and the first RadioButton is set to Checked true.

Clicking all but the first RadioButton causes the UpdatePanel to update, as expected. However, clicking the first RadioButton does nothing. If I remove the Checked="true" attribute from the first RadioButton, I get the desired behavior.

This is with July CTP.

-MT

This problem is still present in AJAX Beta1!

-MT


I think that your radio button list is outside the update panel. If that is the case, than the issue you have mentioned is by design.
Note that on an async post, only the controls which are inside the update panel gets updated. The radio button list is outside the update panel and hence it wont get updated.

What you can do instead is put the radio button list inside another update panel and set the UpdateMode of that updatepanel to conditional.
This would ensure that the radio button list is updated on every checkchange event.

vineetc


vineetc:

I think that your radio button list is outside the update panel. If that is the case, than the issue you have mentioned is by design.
Note that on an async post, only the controls which are inside the update panel gets updated. The radio button list is outside the update panel and hence it wont get updated.

What you can do instead is put the radio button list inside another update panel and set the UpdateMode of that updatepanel to conditional.
This would ensure that the radio button list is updated on every checkchange event.

vineetc

Vineetc, thank you for sounding in. I am pretty sure you are describing a different scenario. What I described should work (and, for the most part, does). I think there is a bug with handling a radiobutton that is set from the beginning.

-MT


Can you post the code

vineetc


vineetc,

This may be an old post but your solution worked great for me. Thanks.