options.eventTarget
come from?Mozilla Firefox gets this value for options.eventTarget
at the end of this function when the anchor tag is called. The Save (anchor tag) button doesn't work in Mozilla, so I'm trying to figure out why.
ExplorerPageHtmlLeft$ct...aveCancelDelete$LBuSave <===== problem
Internet Explorer gets this value for options.eventTarget
at the end of this function when the anchor tag is called. The Save (anchor tag) button works fine in Internet Explorer.
ExplorerPageHtmlLeft$ctl02$ctl00$SaveCancelDelete$LBuSave
<a
id="ExplorerPageHtmlLeft_ctl02_ctl00_SaveCancelDelete_LBuSave"
href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ExplorerPageHtmlLeft$ctl02$ctl00$SaveCancelDelete$LBuSave", "", true, "", "", false, true))"
onclick="javascript:encryptField(document.getElementById('ExplorerPageHtmlLeft_ctl02_ctl00_SaveCancelDelete_TxtPassword'),document.getElementById('IHHidden'));"
>
<img border="0" alt="Save" src="/images/save.gif">
</a>
<a
onclick="javascript:encryptField(document.getElementById('ExplorerPageHtmlLeft_ctl02_ctl00_SaveCancelDelete_TxtPassword'),document.getElementById('IHHidden'));"
id="ExplorerPageHtmlLeft_ctl02_ctl00_SaveCancelDelete_LBuSave"
href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ExplorerPageHtmlLeft$ctl02$ctl00$SaveCancelDelete$LBuSave", "", true, "", "", false, true))"
>
<img src="/images/save.gif" border="0" alt="Save">
</a>
function WebForm_DoPostBackWithOptions(options) {
var validationResult = true;
if (options.validation) {
if (typeof(Page_ClientValidate) == 'function') {
validationResult = Page_ClientValidate(options.validationGroup);
}
}
if (validationResult) {
if ((typeof(options.actionUrl) != "undefined") && (options.actionUrl != null) && (options.actionUrl.length > 0)) {
theForm.action = options.actionUrl;
}
if (options.trackFocus) {
var lastFocus = theForm.elements["__LASTFOCUS"];
if ((typeof(lastFocus) != "undefined") && (lastFocus != null)) {
if (typeof(document.activeElement) == "undefined") {
lastFocus.value = options.eventTarget;
}
else {
var active = document.activeElement;
if ((typeof(active) != "undefined") && (active != null)) {
if ((typeof(active.id) != "undefined") && (active.id != null) && (active.id.length > 0)) {
lastFocus.value = active.id;
}
else if (typeof(active.name) != "undefined") {
lastFocus.value = active.name;
}
}
}
}
}
}
if (options.clientSubmit) {
__doPostBack(**options.eventTarget**, options.eventArgument);
}
}
Well, it appears that the value of the options.eventTarget is not the issue at all. It was strange that it was exactly exactly 50 characters.
options.eventTarget in Firebug: "ExplorerPageHtmlLeft$ct...aveCancelDelete$LBuSave"
It turns out that Mozilla Firefox Firebug only shows 50 characters.. it takes the first and last part of the control client ID (and the 3 dots in the middle) and sticks that into the value field within the Firebug watch variable. To confirm, I just put "alert(options.eventTarget)" into the watch variable, and it showed the entire value. So that definitely isn't it!
I still have no idea why my LinkButton doesn't call my event handler in my code behind in Mozilla, but it does in Internet Explorer. I guess once I have more information, I will post it (probably on a different question). It might have something to do with having validation turned on when my link button is clicked. That's what causes ASP.NET to put this function into the client code automatically I guess.