473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

TreeView checkboxes AutoPostBack with AJAX

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:

<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 ... </TreeViewThis 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?

Mar 20 '07 #1
1 6163
the treeview is not currently supported inside an updatepanel. you will
need a different approach.

-- bruce (sqlwork.com)

Dmitry Perets wrote:
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:

<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 ... </TreeViewThis 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?
Mar 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Billy Jacobs | last post by:
Problem: 1.I want to use the treeview control. 2.I only want checkboxes on some nodes. I don't know how to accomplish this easily. Any suggestions? Billy Jacobs
2
by: James L | last post by:
I want to remove check boxes for the child nodes but keep a check box for the parent node. Does anyone have any ideas? Thank you kindly. Warm Regards.
1
by: Srinivasa Raghavan | last post by:
Hi All, I have some doubts on the Treeview control and Form Authentication 1) will Form Authentication work if cookies are disabled. 2) I have problem in the following code (TreeView...
2
by: Alex D. | last post by:
Does anybody knows how to enable autopostbcak in a TreeView when a checkbox in a node is checked (or unchecked)?? Thanks, Alex.
4
by: Justin | last post by:
I'm writing an app in C# .net 2.0. I want to have a TreeView where the first level of nodes would have check boxes, but their subsequent children would not have check boxes. Is this achievable...
0
by: J | last post by:
Hello All! I need to be able to databind a treeview full of checkbox (selections). The many selections are subsequently used to build an SQL Query. Currently using the new VS2005...
1
by: Victor Rodriguez | last post by:
Is there a way that I can have a client side event like oncontextmenu="showfunction();" on each node? thanks, Victor
0
by: Dmitry Perets | last post by:
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: <script language="javascript" type="text/javascript"> ...
4
by: JJ | last post by:
I want to be able to display items and their categories on a page, so that the user can click on an item to edit it, or add further items or categories. Simple enough, however, I want to do it...
2
by: Ralf Riedel | last post by:
Hi all, I am writing an asp.net application in C# where I use a treeview. That treeview gets populated upon initialization from an SQL Server database. The treeview has checkboxes visible for all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.