ASPX templates
Version 5.x > ASPX templates > WebParts in aspx page View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
adam - 6/15/2011 12:41:08 PM
   
WebParts in aspx page
i have a aspx template and want to add custom webparts to it but no design tab is showing.

when i add a cmswebpartzone i get an error.

how can i get webparts in aspx pages

User avatar
Member
Member
kentico_michal - 6/16/2011 1:10:35 AM
   
RE:WebParts in aspx page
Hello Adam,

Well, there is no Design tab in the ASPX templates by default. The approach based on ASPX templates is intented to build ASPX pages in Visual Studio. Therefore, at least basic programming knowledge of ASP.NET and either C# or VB.NET is required.

I would recommend going through the following articles:

Portal templates vs ASPX templates
ASPX versus Portal Engine developement in Kentico
ASPX page templates how it works

So, if you want to add a new web part to ASPX template you will need to register the web part at first and then you can use it without any problem.

The following example shows how you can register and use the Repeater web part:

<%@ Register Src="~/CMSWebParts/Viewers/cmsrepeater.ascx" TagName="repeater" TagPrefix="uc1" %>

<uc1:repeater runat="server" ID="NewsRepeater" ClassNames="CMS.News" OrderBy="NewsReleaseDate DESC" TransformationName="CMS.News.NewsWithSummary" SelectedItemTransformationName="CMS.News.NewsDetail" PagingMode="querystring" PagerPosition="bottom" ResultsPosition="top" ShowNewButton="True" NewButtonText="Add news" ShowEditDeleteButtons="True" />



Best regards,
Michal Legen

User avatar
Certified Developer v7
Certified  Developer v7
adam - 6/16/2011 3:13:17 AM
   
RE:WebParts in aspx page
Hi thanks for your reply

i know how to do that using aspx pages but what i wanted was to create the ability for the client to be able to place webpart in pages within the cms but only in certain parts ie (webpart zones from portal templates). i want them to be able to add remove webparts as they choose from these zones.

is there no way of creating an aspx template and adding the webpart zone or is the only option in this case to create portal template.

i just prefer aspx templates as its more standard .net work.

i guess i can just convert my aspx templates to portal pages just wish there was a way of getting webparts within aspx instead


User avatar
Member
Member
kentico_michal - 6/16/2011 3:31:42 AM
   
RE:WebParts in aspx page
Hello,

Regrettably, this is currently not supported and it is not possible to enable the Design tab in ASPX templates. However, you have an option of combining both approaches: Combining aspx templates and portal engine templates.

Best regards,
Michal Legen

User avatar
Certified Developer v7
Certified  Developer v7
adam - 6/16/2011 3:39:54 AM
   
RE:WebParts in aspx page
hi

i don't see how i can use that approach if i want the ability for the client to add webparts to zones on all pages. unless i'm missing something.

so on all my pages i have main content which is either editble region or a cms:cmsrepeater control that is pulling through doc types etc and then on the right a column for the client to put a number of webparts and customise them for each page. i think i need portal pages, what do you think?

can you use cmsrepeater in portal pages?


User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 6/16/2011 4:13:14 AM
   
RE:WebParts in aspx page
Hi,

If you would like allow editors add/remove web part from CMS Desk it will be needed to convert your site to Portal Engine. In version 6.0 combination of Portal Engine and ASPX templates will be more supported.

CMS repeater is available in Portal pages - see the repeaterweb part.

To register your custom web part for use in portal engine please take a look at Developing custom web part, step 10.

Best regards,
Ivana Tomanickova