Tuesday, April 20, 2010

RadioButtonList - Ajax - workaround - extension

CONTENT IS OUTDATED ! 

PLEASE CHECK THIS NEWER POST REGARDING THIS ISSUE

http://blog.ediot.net/2010/06/ajax-causes-full-postback-in-windows-xp.html


I've written an extension to simplify the workaround. I'm not a whiz programmer, so hopefully someone might help me improve this code.

Update * To make it work in FF, change the LinkButton to a Button in the extension code below. Reason : FF does not support javascript click() function for links, but does for buttons





How to use this :

myRadioButtonList.FixAjaxPostbackBug(MyUpdatePanel, AddressOf myFunction)

That's it. The limitation is, you have to call this function everytime in pageload and everytime after u dynamically add items to your radiolistbutton, because the hidden link is dynamically added to the updatepanel.

Works well in IE,  Opera, FF (Read up) and I'm happy with it.  

RadioButtonList - Ajax - Bug - workaround

CONTENT IS OUTDATED ! 

PLEASE CHECK THIS NEWER POST REGARDING THIS ISSUE

http://blog.ediot.net/2010/06/ajax-causes-full-postback-in-windows-xp.html


I can't believe RadioButtonList's autopostback still cannot post asynchronously even in VS2010/asp.net 4.0

I've come up with a simple solution, though it's kinda ugly. Alternatively, I could make a custom web control (ascx or dll)

Before :




After :