TreeView checkboxes AutoPostBack with AJAX

Discussion in '.NET' started by Dmitry Perets, Mar 20, 2007.

  1. Dmitry Perets

    Dmitry Perets

    Joined:
    Mar 20, 2007
    Messages:
    1
    Hello,

    There is a known problem with TreeView checkboxes in ASP.NET: they can't do AutoPostBack. So I've solved this problem like this:

    Code:
    <script language="javascript" type="text/javascript">
    
    function postbackOnCheck()
    {
       var o = window.event.srcElement;
       if (o.tagName == 'INPUT' && o.type == 'checkbox' &&
           o.name != null && o.name.indexOf('CheckBox') > -1)
       {
          __doPostBack("","");
       }
    }
    
    </script>
    
    <asp:TreeView onclick="postbackOnCheck()" ID="treeContent"
     runat="server"> ... And so on ... </TreeView>
    This way I get full postback each time the user checks\unchecks the checkbox.

    But now I want to modify this code in order to make use of AJAX: I don't want the FULL postback, but I only want the tree itself to be updated. Of course, I've started by placing it inside the UpdatePanel. But what now? Can somebody help me with this issue?
     
    Dmitry Perets, Mar 20, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex D.

    treeview and autopostback

    Alex D., Oct 28, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    7,568
    Alejandro Penate-Diaz
    Oct 30, 2005
  2. Dmitry Perets

    TreeView checkboxes AutoPostBack with AJAX

    Dmitry Perets, Mar 20, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    839
    bruce barker
    Mar 20, 2007
  3. ton
    Replies:
    2
    Views:
    2,169
  4. Stefan
    Replies:
    0
    Views:
    166
    Stefan
    Jul 18, 2003
  5. Stu

    Treeview JS error when AutoPostBack=True...

    Stu, Jul 23, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    126
Loading...

Share This Page