Dynamic Javascript Confirm Box from ASP.NET

  • Thread starter Thread starter marksommerville
  • Start date Start date
M

marksommerville

Anybody know how to display a dynamic message in a confirm dialog. I
have 2 check boxes and a button. On button click I want to be able to
display a confirmation dialog depending on whether or not I have the
checkboxes checked. No check = no dialog, check 1 = "Are you sure you
want to delete A?", check 2 = "Are you sure you want to delete A and
B?"
 
Anybody know how to display a dynamic message in a confirm dialog. I
have 2 check boxes and a button. On button click I want to be able to
display a confirmation dialog depending on whether or not I have the
checkboxes checked. No check = no dialog, check 1 = "Are you sure you
want to delete A?", check 2 = "Are you sure you want to delete A and
B?"
your question is not explicit !
yes you have a checkbox, but where ? in a datagridview ? , the page ? ...
you can use ajax tool kit to perform differents controls... or simply :
myconrol.Attribut.Add("onclick",@"if(document.getElementById('"+yourcheckbox.ClientID+@"').checked){
if( confirm('are your sure you want to delete ?'))
{
this.form.submit();//? put your code here... a dopostback ?
}}");
 
Back
Top