ASP.NET TreeView code that works in all browsers except Firefox

The following .NET 4.0 code functions perfectly in IE9, Chrome 20 and Opera 12 but fails miserably in Firefox 13. All the browsers are default installs without plugins.

<html xmlns="">
<head runat="server"><title></title>
    <form id="form1" runat="server">
       <asp:TreeView ID="Treeview1" Runat="server" 
            ShowCheckBoxes="All" >
              <asp:TreeNode Value="Child1" Expanded="True" Text="1">
                <asp:TreeNode Value="Grandchild1" Text="A" />
                <asp:TreeNode Value="Grandchild2" Text="B" />
               <asp:TreeNode Value="Child2" Text="2" />
               <asp:TreeNode Value="Child3" Expanded="True" Text="3">
               <asp:TreeNode Value="Grandchild1" Text="A" />
       <asp:TextBox ID="TextBox1" runat="server" Height="156px" TextMode="MultiLine" 
  <script language="javascript" type="text/javascript">
      function postBackByObject() {
         var o = window.event.srcElement;
         if (o.tagName == "INPUT" && o.type == "checkbox") {
             __doPostBack("", "");

I am trying to catch the TreeNode checkbox events with the following code behind:

  protected void Treeview1_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
     TextBox1.Text += e.Node.Text;

This is quite annoying - any solution is welcome!


try handling the event more generically, so it works in both FF and other browsers.



function postBackByObject(e) {
    var evt = e || window.event;
    var o = || evt.srcElement; 
    if (o.tagName == "INPUT" && o.type == "checkbox") {
        __doPostBack("", "");

edit i forgot to add a line for target / srcElement

Need Your Help

Django 1.9 cannot connect to the MySQL server (blank screen)

python mysql django

I recently upgraded the MySQL version to 5.7.11 and Django to 1.9.2.

Python 3.4: contour plot display on dynamic map using unstack and mplleaflet

python matplotlib contour geopandas

I am having a problem getting a contour plot to display on top of an mplleaflet map. I am fairly certain this is because I'm not sure how to tell mplleaflet where to orient my contour plot on the m...