tags:

views:

17

answers:

2

I have a button on a webpage that has the following added programmatically to its “Attributes” property.

btnDeleteNode.Attributes.Add("onclick", "if(confirm('delete this node?')){}else{return false}");

This works fine but now I need to check to see if the user has selected a node in a tree before asking if they want to delete it. If a node isn’t selected I need to tell the user to select one. My question is, can I do this using the above method (I don’t know java script) or should I use a different approach ?

A: 

You can set a flag (using javascript) on selection of any node and check the flag here.

Kangkan
A: 

You can use a flag or use from Asp Validators

Nasser Hadjloo