I'm after what seems to me to be a straightforward pattern for handling page refreshes when I've got a drop-down that reacts to the onchange
event.
I've used the following in the vb code behind (in the Load
handler):
MyDropDown.Attributes.Add("onchange", "ProcessDDChange(this.value);")
Function ProcessDDChange()
is in-page JavaScript that grays out some other form inputs for certain values of the drop down.
This works fine, but after a postback, onchange
is apparently not fired when the previous state is restored, so disabled boxes are enabled again.
I've investigated load
events (page and drop-down), but both fire too early to be of use and I can't see any later options.
Is there a standard way of doing this? I need a hook for running a js function post DOM setup, post asp state restore.
Info
I'm using .net 3.5 and I'm looking for a cross browser solution. This is not my project, so I can't add jQuery (much as I'd like to) or other libs.