Hi all

I am developing a page where user can insert update delete his information. I am doing as follows

when user clicks the "Delete" button, a MsgBox pops and asks to confirm the delete process.

if (user clicks "yes" in msgbox)

system deletes the information.

else

system does not delete the information and loads the page default values.

What I want to do is:

if (user clicks "delete" button on page)

1) the page gets disabled.

2) a message box pop up

(2.1) user should not be able to do anything on the page unless he clicks either "yes" or "no" on the msgbox

(2.2) msgbox must remain on top of page even if user clicks on the page after msgbox pop up.

I want to implement the above if condition and specifically (1) and (2) fully.

please help...

thanks in advance..

Dani AI

Generated

Short answer: you need a client-side modal (not a server MsgBox) that places a full-screen overlay under a dialog and prevents interaction until the user chooses. described the behavior well; pointed to the ModalPopupExtender as one option. ModalPopupExtender (ASP.NET AJAX Toolkit) works, but there are simpler and more modern choices too (see links below).

Implementation outline you can apply today:

  • Add a full-screen overlay DIV (position:fixed; top:0; left:0; width:100%; height:100%) and a dialog DIV centered above it; give the overlay a high z-index and the dialog an even higher z-index so it stays on top.
  • Show the overlay + dialog from client-side script when the Delete button is clicked. Use the button attribute OnClientClick="showConfirm(); return false;" so the client shows the modal and cancels the immediate postback. If the user clicks Yes then trigger the postback (__doPostBack or let a hidden submit button do it).
  • For a native approach, consider the HTML5 <dialog> element with showModal() for built-in modal behavior and simpler focus handling (dialog element).

Accessibility and polish:

  • Mark the dialog role="dialog" and aria-modal="true", move keyboard focus into the dialog on open, trap Tab/Shift+Tab, and restore focus to the originating control when closed. Follow the WAI-ARIA dialog guidance (WAI-ARIA practices).

Troubleshooting tips:

  • If the modal disappears after an AJAX partial postback, re-show it via ScriptManager.RegisterStartupScript. If some page elements (iframes, legacy plugins) appear above the overlay, raise z-index or use an iframe shim for old browsers. If you prefer a ready-made control, the AjaxControlToolkit ModalPopup is still usable, but modern projects often use Bootstrap/jQuery UI modals or the native <dialog>. For wiring client-side handlers on ASP.NET buttons, see OnClientClick for details (Button.OnClientClick).

Hi all

I am developing a page where user can insert update delete his information. I am doing as follows

when user clicks the "Delete" button, a MsgBox pops and asks to confirm the delete process.

if (user clicks "yes" in msgbox)

system deletes the information.

else

system does not delete the information and loads the page default values.

What I want to do is:

if (user clicks "delete" button on page)

1) the page gets disabled.

2) a message box pop up

(2.1) user should not be able to do anything on the page unless he clicks either "yes" or "no" on the msgbox

(2.2) msgbox must remain on top of page even if user clicks on the page after msgbox pop up.

I want to implement the above if condition and specifically (1) and (2) fully.

please help...

thanks in advance..

Try this
dotnetkicks.com/aspnet/ModalPopupExtender_to_show_a_MessageBox
http://www.codeproject.com/KB/ajax/ModalPopup_Message_Box_.aspx


Mark as solved if it helps you!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.