javascript + ASP Net newbie help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following in my click event of a button control:
if(.....)
{
this.Page.RegisterStartupScript(@"startup",@"<script>alert('This project
cannot be deleted until all tasks have been deleted first.');</script>");}
else
{this.Page.RegisterStartupScript(@"startup",@"<script>return confirm('Are
you sure you wish to delete this project?');</script>");
...
My first Alert msg box fires, but not my second (I do hit it in the else
clause but no confirm actually pops up)
can anyone help? Also, how will I know the result of the confirm box?
 
Hi,
Instead of Page.RegisterStartupScript use <buttonobj>.Attributes.Add and
add a javascript funtion It automatically cancels the post back if the user
clicks No in the window.confirm dialog
 
Back
Top