I am trying to implement a modal pop up (partial view) in asp.net mvc without using javascript / jquery.
Is there a way how this can be achieved.
Most, if not all, modals have an JavaScript/jQuery API because modals are generally triggered on the client. We don't know what modal you are working with and you have not provided any code which makes providing a solution difficult.
Most modal require JavaScript, but if you just mean you don’t write any, you can use the bootstrap modal. Just use the markup for it to show. Otherwise if you mean no JavaScript you will need to create you own CSS.
anyway it pretty simple, the partial should include modal display code. On post back, when you want the modal, call the partial. The close button on the partial should do a post back.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
6 Points
43 Posts
showing modal pop up in asp.net mvc as partial view
May 23, 2020 07:08 AM|ashvinvee|LINK
Hi,
I am trying to implement a modal pop up (partial view) in asp.net mvc without using javascript / jquery.
Is there a way how this can be achieved.
Thanks in advance,
Ashvin
All-Star
53001 Points
23595 Posts
Re: showing modal pop up in asp.net mvc as partial view
May 23, 2020 12:14 PM|mgebhard|LINK
Most, if not all, modals have an JavaScript/jQuery API because modals are generally triggered on the client. We don't know what modal you are working with and you have not provided any code which makes providing a solution difficult.
All-Star
58164 Points
15647 Posts
Re: showing modal pop up in asp.net mvc as partial view
May 23, 2020 04:57 PM|bruce (sqlwork.com)|LINK
Most modal require JavaScript, but if you just mean you don’t write any, you can use the bootstrap modal. Just use the markup for it to show. Otherwise if you mean no JavaScript you will need to create you own CSS.
anyway it pretty simple, the partial should include modal display code. On post back, when you want the modal, call the partial. The close button on the partial should do a post back.
Contributor
2690 Points
774 Posts
Re: showing modal pop up in asp.net mvc as partial view
May 26, 2020 01:53 AM|YihuiSun|LINK
Hi, ashvinvee
Note:
Index
_showParticalView
Here is the result.
Best Regards,
YihuiSun