__EVENTTARGET not being set on partial postback

aemon

New Member
I have an asp.net project, and I want to grab the control causing the postback in javascript.The element causing the postback is inside of an updatepanel and everything is working as it should. However, I have a javascript function that runs on the "onfocus" event of that control that's being run each time the selected index is changed.So my plan was to compare the id of the control in the javascript function with the id of the control that caused the postback by referencing.\[code\]document.getElementById('__EVENTTARGET');\[/code\]To my surprise, this hidden field isn't being updated with a partial postback. However in the codebehind I can access the exact same parameter and get the value I'm looking for using:\[code\] Page.Request.Params("__EVENTTARGET")\[/code\]Right now I'm setting the javascript value in the code behind and it's working. But this is really a band aid, since this js function is run on many pages, I would rather it work without having to add this fix on each page.Any ideas?
 
Top