Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 22, 2012 02:16 PM by Young Yang - MSFT
Member
54 Points
31 Posts
Mar 16, 2012 12:44 AM|LINK
Hi, Ive been trying to implement a colorbox popup for the past 2 days and Im at stuck at pretty much the last step. I have an anchor that, when clicked, should load in a colorbox into a container I have set up in _Layout.cshtml
<a href="@Url.Action("RenderColorbox", "ContactPartial", new { path = "_ContactPartial" })" class="colorboxLink"><span>ContactUs</span></a>
Here is the js ajax request to load the partialview (_ContactPartial.cshtml) into its container in the _Layout.cshtml
$('.colorboxLink').click(function () { $('.colorbox_container').load(this.href, function () { var colorboxOptions = { inline: true, scrolling: false, opacity: ".9", fixed: true } $('#contactColorbox').colorbox(colorboxOptions); //I need this to work. }); return false; //return false for click event otherwise partial view will load on seperate page });
Here is the partial view itself (_ContactPartial.cshtml)
@model MVC4.Models.ContactForm <div id="contactColorbox"> @using (Html.BeginForm("Index", "ContactPartial", FormMethod.Post)) { ...... } </div>
The partial view loads into its container correctly but is does not do so as a colorbox but rather as an un-animated popup modal. Can someone help me get the view to load as a colorbox. Thanks
Mar 16, 2012 11:16 PM|LINK
Bump. I still cant resolve this please help.
All-Star
137649 Points
22143 Posts
Moderator
MVP
Mar 17, 2012 08:24 AM|LINK
It's a HTML issue.
Look at the page and see if all css / js are correctly registered
http://bit.ly/asp5Mistakes
Mar 17, 2012 06:17 PM|LINK
ignatandrei It's a HTML issue. Look at the page and see if all css / js are correctly registered http://bit.ly/asp5Mistakes
I couldnt get this resolved so i dropped the colorbox and implemented jquery UI dialog with much less problems. shouldve done that from the start =p
21742 Points
1825 Posts
Microsoft
Mar 22, 2012 02:16 PM|LINK
Hi
Look this article:
http://www.weirdlover.com/2010/05/14/mvc-render-partial-modal-pop-up-via-jquery-and-colorbox-part-1/
Hope this helpful Regards Young Yang
techtalk718
Member
54 Points
31 Posts
ASP.NET MVC4 and Colorbox Plugin via Partial View
Mar 16, 2012 12:44 AM|LINK
Hi,
Ive been trying to implement a colorbox popup for the past 2 days and Im at stuck at pretty much the last step.
I have an anchor that, when clicked, should load in a colorbox into a container I have set up in _Layout.cshtml
<a href="@Url.Action("RenderColorbox", "ContactPartial", new { path = "_ContactPartial" })" class="colorboxLink"><span>ContactUs</span></a>Here is the js ajax request to load the partialview (_ContactPartial.cshtml) into its container in the _Layout.cshtml
$('.colorboxLink').click(function () { $('.colorbox_container').load(this.href, function () { var colorboxOptions = { inline: true, scrolling: false, opacity: ".9", fixed: true } $('#contactColorbox').colorbox(colorboxOptions); //I need this to work. }); return false; //return false for click event otherwise partial view will load on seperate page });Here is the partial view itself (_ContactPartial.cshtml)
@model MVC4.Models.ContactForm <div id="contactColorbox"> @using (Html.BeginForm("Index", "ContactPartial", FormMethod.Post)) { ...... } </div>The partial view loads into its container correctly but is does not do so as a colorbox but rather as an un-animated popup modal. Can someone help me get the view to load as a colorbox.
Thanks
techtalk718
Member
54 Points
31 Posts
Re: ASP.NET MVC4 and Colorbox Plugin via Partial View
Mar 16, 2012 11:16 PM|LINK
Bump. I still cant resolve this please help.
ignatandrei
All-Star
137649 Points
22143 Posts
Moderator
MVP
Re: ASP.NET MVC4 and Colorbox Plugin via Partial View
Mar 17, 2012 08:24 AM|LINK
It's a HTML issue.
Look at the page and see if all css / js are correctly registered
http://bit.ly/asp5Mistakes
techtalk718
Member
54 Points
31 Posts
Re: ASP.NET MVC4 and Colorbox Plugin via Partial View
Mar 17, 2012 06:17 PM|LINK
I couldnt get this resolved so i dropped the colorbox and implemented jquery UI dialog with much less problems. shouldve done that from the start =p
Young Yang -...
All-Star
21742 Points
1825 Posts
Microsoft
Re: ASP.NET MVC4 and Colorbox Plugin via Partial View
Mar 22, 2012 02:16 PM|LINK
Hi
Look this article:
http://www.weirdlover.com/2010/05/14/mvc-render-partial-modal-pop-up-via-jquery-and-colorbox-part-1/
Hope this helpful
Regards
Young Yang
Feedback to us
Develop and promote your apps in Windows Store