two difference javascript alert using check boxes and delete button
-
Hai sir, I am using checkboxes in a header templates and some checkboxes in item templates,if chkHeader is checked then all the chkitem are checked.code behind is used for this, these check boxes and one btndelete button is used for deletion,i want two javascript alert for this delete button,delete button is outside of the grid , if any check box is selected then i want to dispaly th e java scrip alert "please choose an item" otherwise i f any one checkbox is checked and click the delete button then i want to display "are u want to delete this item" ,I cannot get the proper clientId for checkboxes,please help me(asp.net, c#,ajax,javascript)
-
Hai sir, I am using checkboxes in a header templates and some checkboxes in item templates,if chkHeader is checked then all the chkitem are checked.code behind is used for this, these check boxes and one btndelete button is used for deletion,i want two javascript alert for this delete button,delete button is outside of the grid , if any check box is selected then i want to dispaly th e java scrip alert "please choose an item" otherwise i f any one checkbox is checked and click the delete button then i want to display "are u want to delete this item" ,I cannot get the proper clientId for checkboxes,please help me(asp.net, c#,ajax,javascript)
You need to wire up the javascript call on the server side. You will only really be able to get the client ID on the server, where all that information is readily available. Something like the following:
void Page_Load(...)
{
chkMyCheckBox.Attributes.Add("onclick", "jsVerify('" + chkMyCheckBox.ClientID + "')");
}