Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Loading a webpart control in another site (non kentico, but c#) View modes: 
User avatar
Member
Member
gatsby0121 - 7/25/2011 1:28:29 PM
   
Loading a webpart control in another site (non kentico, but c#)
I have a client that's migrating from a c#.net site to kentico. I've already built the kentico site, and have a custom registration form webpart created.

They are transitioning from their newsletter to the kentico one, and would like to have the users on their current site click on a subscribe now button, that loads a popup of in their site of our registration webpart that would then allow the user to register without leaving their site (currently one tab in the site actually loads the kentico site, and the user doesn't realize that their not in the old site)

Is this possible?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/25/2011 11:08:16 PM
   
RE:Loading a webpart control in another site (non kentico, but c#)
Hello,

Could you please describe in more detail how the popup box should look and work?

Is this only a javascript popup or a new window or an iframe?

Best regards,
Boris Pocatko

User avatar
Member
Member
gatsby0121 - 7/26/2011 11:10:54 AM
   
RE:Loading a webpart control in another site (non kentico, but c#)
basically they just want the webpart, none of the site around it to popup in a window, doesn't matter if it's a javascript popup, new window or iframe, whichever will work and allow them to update the user information

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/27/2011 7:08:24 AM
   
RE:Loading a webpart control in another site (non kentico, but c#)
Hello,

You can use several approaches:

You can use simply our Lightbox web part and insert your control code the following way into the transformation (Selected item transformation):

<%@ Register Src="~/CMSWebParts/Text/statictext.ascx" TagName="statictext" TagPrefix="uc1" %>

<uc1:statictext ID="StaticText1" runat="server" Text="Static text inserted using Static text webpart." EnableViewState="false" />

You can test this on a sample site in the section Examples / Web parts / Listings and viewers / Light box.
Or you can create javascript method from scratch as described here.

The last approach which comes to my mind is to create a new OnClick event on a button which would bring up the desired page with your code:

Button1.Attributes.Add("OnClick", "window.open('CoustomForm.aspx',null,'Height=300;left=100;Width=300;top=100;menubar=no;toolbar=no;scrollbars=yes');");

Best regards,
Boris Pocatko