views:

97

answers:

2

Here is my scenario. I am going to have a page with the treeview displayed. A user can add and delete nodes: when the user clicks on the node, a pop up will come up with a form, where a user will enter data, this data then gets saved into the database, and the pop-up script comes back with the id (from the database). This id needs to get passed to the parent page and the tree needs to be updated on the CLIENT.

When the user is done modifying the tree, they will click on the save button and the tree will be saved in the database.

I am using asp.net webforms, c#.

How should I go about achieving these objectives? The way I see it, I won't need to use ajax as the tree modification is done on the client side. The trick would be to get the pop-up return an id (which comes from the server onto the parent page). Please advise. Should I use TreeView control or a simple tree plugin from say - jQuery? (keep in mind that I will need to submit the parent page to the server and save the data in the tree to the database).

The way I see it, my only option is a Jquery tree. But us it accessible to the aspx page on submit? HELP!

A: 

If you are saving the data into the database in the child window, just have it do a post back on the parent window when it closes, this will force the tree to reload from the database, showing the newly inserted data.

theG
but i don't want that, please read my question. The data that is saved by the pop up should be independent from the tree. The tree itself shouldn't be saved to the database until the user presses 'Save' button on the parent page.
gnomixa
In my scenario, a node is an independent structure, so if a user adds a new node, the node should be saved to the database with its ID returned to the tree. ONLY WHEN A USER SAVES A TREE, THE RELATION OF THE NODE TO THE TREE WILL BE SAVED. hope this makes sense.
gnomixa
When the pop-up submits, it should therefore return that ID (unique node id from the database) and update the tree with Javascript.
gnomixa
A: 

man, i dont know why Ajax wont help you, but in that case yeah jqurey, and then getting the inner html of control you want, then do foreach to get the Tree nodes and save them in a collection then submit them to DB with some web service methods, you can achieve what you want.

but again with AJAX i think it is much more simpler and you wont loose anything.

sorry for not providing smaple.

hope this helps

isn't what you essentially described AJAX?"getting the inner html of control you want, then do foreach to get the Tree nodes and save them in a collection then submit them to DB with some web service methods"
gnomixa
looks like ajax to me
gnomixa
if you want to save to DB you will have to do some server side coding, so you either use jquery with web service( which is really fast) or just make a normal function and hook it to a button or something and put that button in update panel.you can also use thick box for the popup then use jquery to get inner html of the tree(this is not server side, it is client side).i wish i could be more helpful but that is all i know.