Chris
Chris

Reputation:

Setting the focus to a MsgBox object

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

Answers (3)

Yordan Georgiev
Yordan Georgiev

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

RichardOD
RichardOD

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

dev.e.loper
dev.e.loper

Reputation: 36044

Are you talking about javascript message box?

Upvotes: 0

Related Questions