Reputation:
In my application, a user clicks a "save" button and is then presented with a MsgBox confirmation simply stating "Are you sure you want to save?", or something along those lines.
It's been hit or miss, but occasionally, this MsgBox will load behind the browser rather than be the center of attention with focus. How can I stop this from happening?
Thanks in advance :)
Upvotes: 0
Views: 1626
Reputation: 5430
The dode to add a simle JavaScript confirmation diagog in code behind ...
buttonSaveId.Attributes.Add("OnClick" , "return (confirm('Do you really want to save ?! '));"
Upvotes: 0
Reputation: 29157
If you are using ASP.NET WebForms and it is an intranet app, have you looked at using the ASP.NET AJAX ModalPopup control? Thay way you don't really have a 2nd window.
Upvotes: 1