header

Linkbutton postback issue on Firefox (fix)
Posted on August 12, 2007 10:58 by menace

While working on a form, I noticed that the linkbutton is getting a script error during a postback, and it only happens on Firefox (it works fine on IE).
The error says that it's missing a function. I finally found a way around this issue and it worked for me.

Code (Javascript):

   1: <script language="javascript" type="text/javascript">
   2: <!--
   3: function __doPostBack(eventTarget, eventArgument) {
   4: var theform;
   5: if (window.navigator.appName.toLowerCase().indexOf("m icrosoft") > -1) {
   6: theform = document.Form1;
   7: }
   8: else {
   9: theform = document.forms["Form1"];
  10: }
  11: theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
  12: theform.__EVENTARGUMENT.value = eventArgument;
  13: theform.submit();
  14: }
  15: // -->
  16: </script>

Comments are closed
     

Blog Menu

Recent Posts Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
Current date is: Wednesday, January 07, 2009
Copyright © Menace Studio 2005-2009. Dennis Rongo. All rights reserved.