Linkbutton postback issue on Firefox (fix)

By: Dennis Rongo | August 12, 2007

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