M
Mike Malter
I have scoured the web looking for an example of how to do a javascript confirm box in .NET.
Is there any way to do it?
Thanks.
Is there any way to do it?
Thanks.
I have scoured the web looking for an example of how to do a
javascript confirm box in .NET.
Matt Berther said:Hello Mike,
control.Attributes.Add("onClick", "return confirm('Your Message');");
where control is the control you want the confirm box attached to. Keep in mind that this will not postback unless the user selects OK.
C:\Projects\SSSC\Cheese\wwwroot\ManageBrand.aspx.cs(51): Invalid token
'(' in class, struct, or interface member declaration
My code is as follows:
protected System.Web.UI.WebControls.Button bDelete;
bDelete.Attributes.Add("onClick", "if (!confirm('Are you sure you want
to delete?')) return false;");