Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:14:55+00:00 2026-06-07T15:14:55+00:00

The following .NET 4.0 code functions perfectly in IE9, Chrome 20 and Opera 12

  • 0

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="http://www.w3.org/1999/xhtml">
<head runat="server"><title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <asp:TreeView ID="Treeview1" Runat="server" 
            onclick="javascript:postBackByObject()"
            ontreenodecheckchanged="Treeview1_TreeNodeCheckChanged" 
            ShowCheckBoxes="All" >
            <Nodes>
              <asp:TreeNode Value="Child1" Expanded="True" Text="1">
                <asp:TreeNode Value="Grandchild1" Text="A" />
                <asp:TreeNode Value="Grandchild2" Text="B" />
             </asp:TreeNode>
               <asp:TreeNode Value="Child2" Text="2" />
               <asp:TreeNode Value="Child3" Expanded="True" Text="3">
               <asp:TreeNode Value="Grandchild1" Text="A" />
             </asp:TreeNode>
            </Nodes>
       </asp:TreeView>
       <asp:TextBox ID="TextBox1" runat="server" Height="156px" TextMode="MultiLine" 
            Width="295px"></asp:TextBox>
    </div>
    </form>
 </body>
  <script language="javascript" type="text/javascript">
      function postBackByObject() {
         var o = window.event.srcElement;
         if (o.tagName == "INPUT" && o.type == "checkbox") {
             __doPostBack("", "");
         }
     }
 </script>
 </html>

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:14:58+00:00Added an answer on June 7, 2026 at 3:14 pm

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

    e.g.

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

    edit i forgot to add a line for target / srcElement

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following asp.net code but it gives error when I change dropdown selected
The following C# code (.NET Framework 3.5) returns name and description of all users
I got following code from net and it looks everything is proper but i'm
The following code is visual basic, .NET, ASP... all of the above? Can anybody
I've got the following ASP.NET 4 MVC 3 code in a view: @Html.TextBoxFor(model =>
The following code generates a FileNotFoundException (using .NET 2.0): using System; using System.Collections.Generic; using
The following code sample (also at http://jsfiddle.net/MZwBS/ ) var items = []; items.push({ example:
The following is my Class code import java.net.*; import java.util.*; import java.sql.*; import org.apache.log4j.*;
I have the following code setup: http://jsfiddle.net/bABHU/2/ Had to change it a little bit
I have following code that I am compiling in a .NET 4.0 project namespace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.