TreeView checkboxes AutoPostBack with AJAX

Joined
Mar 20, 2007
Messages
1
Reaction score
0
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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top