Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best option for modal popup window in ASP.NET? [closed]

This question was asked a few years ago, so I'm going to ask it again.

I'm looking for the best/cleanest option to display a modal popup window upon the click event of an ASP Button control. The contents of the window will be an aspx page.

Cross-browser compatibility is a requirement

jquery/plugins aren't out of the question if they fit the mold.

like image 844
Lactose Avatar asked Aug 08 '11 20:08

Lactose


People also ask

How can use popup window in asp net c#?

Step 1 : Start a new ASP.NET MVC Web application. Add a new controller called Home and in the Home controller, the Index method is available to you but there is not a view with it so add a view by right-clicking in Index action. Step 2 : In index. aspx add one HTML button to open our modal popup window like below.

How do you close a modal dialog?

There are few ways to close modal in Bootstrap: click on a backdrop, close icon, or close button. You can also use JavaScript hide method. Click the button to launch the modal. Then click on the backdrop, close icon or close button to close the modal.

Do popup blockers block modals?

Yes and no. Native blockers definitely don't do it, they work only with the pop-ups that open in new windows/tabs. Adblockers can be configured to block them by classname or id or some other way to identify them, but they definitely don't block bootstrap modals out of the box.

How do I show modal popup from code behind?

Add logic to the click event to re-open the modal after the post back OR look for an alternative method of posting back to the server such as using AJAX. If you want to do it via AJAX, remove the OnClick event from the button. Add a [WebMethod] to your code behind and call that webmethod using $. ajax.


1 Answers

There are a host of options in the jQuery field:

jQueryUI's dialog

Wijmo's Dialog

SimpleModal

These are just three options out of many. jQueryUI is pretty easy to use out of the box, but isn't as customizable (or easy to) and "pretty" as SimpleModal. At their core, their pretty much all very similar.

If you'd already using jQuery, jQueryUI's option may be a good fit. Wijmo is also jQueryUI compatible/friendly (use the same theme CSS class names and patterns), so it's also a good fit.

So it kind of depends on what you want. Something very simple - maybe jQueryUI. Flashy/pretty -- SimpleModal. More complex but jQueryUI-friendly - Wijmo.

like image 95
David Hoerster Avatar answered Oct 20 '22 17:10

David Hoerster