开发者

ASP.NET MVC and ModalPopupExtender

开发者 https://www.devze.com 2022-12-15 08:08 出处:网络
I am developing an application with ASP.NET MVC and wish to make use of Modal style windows. Here is one example. On my \"Login\" view, I have my login details, but also have a button to create an A

I am developing an application with ASP.NET MVC and wish to make use of Modal style windows.

Here is one example. On my "Login" view, I have my login details, but also have a button to create an Account for the application. I have a separate "CreateAccount" view, but would like it to pop up inside a ModalPopupWindow.

Is this possible usng just ASP MVC and the ASP.NET Ajax Library, or will I have to use a different Ajax library?

(Another way to ask this question: can I redirect the output o开发者_运维技巧f a view into a ModalPopupExtender?)

Jason


I would suggest you returning a PartialView from your controller and loading the result in some jQuery plugin to show popups in the same page context like this

The usage is something like

Boxy.load('/Account/Create'); // You can post additional data if you need to

This way you will have a beautiful Box (facebook like) with your form in it. You just have to be aware that if you post something in it, you should do it using AJAX to update the response in the same Box.

Good Luck!!

0

精彩评论

暂无评论...
验证码 换一张
取 消