Design and CSS styles
Version 4.x > Design and CSS styles > problems creating new web part layout. View modes: 
User avatar
Member
Member
michael.hargreaves-roymorgan - 2/10/2010 11:29:56 PM
   
problems creating new web part layout.
Hey,
I've been trying to edit a web part by creating a new layout.

All I've done is create a new layout then inserted a new id into a div tag.

I'm having trouble getting new layout to display the web parts even if I make no changes to them at all.

I recieve the below error

"
[Error loading the WebPart 'ExpiredPurchases']
http://server/CMSWebPartLayouts/5bda91c8-600b-423f-aeff-ab9cfb5b887a/MemberDashBoard.ascx.cs(912305): error CS0115: 'ASP.cmswebpartlayouts_5bda91c8_600b_423f_aeff_ab9cfb5b887a_memberdashboard___expiredpurchases_tabs_temp_ascx.FrameworkInitialize()': no suitable method found to override
"

Obviously its not as easy as just clicking the (new) layout option and creating one.
I'm wondering if I have to register this somehwere else?

Any help is much apprieciated, let me know if you need more info to this problem.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/11/2010 3:18:33 AM
   
RE:problems creating new web part layout.
Hi,

Could you please try to change the code file setting in the layout? It should be like this:

CodeFile="~/CMSWebParts/Text/editableimage.ascx.cs"

If it won't help, could you please send us the layout code and more details which web part you are editing?

Best Regards,
Juraj Ondrus

User avatar
Member
Member
michael.hargreaves-roymorgan - 2/11/2010 5:45:54 PM
   
RE:problems creating new web part layout.
Hey Juraj,
Thanks for the help, I'm not having much luck though. I'm new to Kentico.

I'm trying to edit the Member Dashboard web part layout, by creating a new layout.

I've provided the layout code below with by change in bold


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MemberDashBoard.ascx.cs"
Inherits="CMSWebParts_RoyMorgan_MemberDashboard" %>
<%@ Register TagPrefix="cc1" Namespace="CMS.Controls" Assembly="CMS.Controls" %>
<asp:PlaceHolder ID="plcNoProductsMessage" runat="server">
<p class="noproductsmsg">
You have not yet purchased any products.</p>
</asp:PlaceHolder>
<asp:PlaceHolder ID="plcProductList" runat="server">
<cc1:CustomTableDataSource ID="ctdsProductTypes" runat="server" CustomTable="RMR.ProductTypes" />
<div class="result">

<asp:Repeater ID="rptProducts" runat="server" OnItemDataBound="Product_ItemDataBound">
<ItemTemplate>
<asp:PlaceHolder ID="plcCurrent" runat="Server" Visible="false">
<div id="content_2" class="entry">
<h2><%# Eval("SKUName")%></h2>
<span class="serial">SKU: <%# DataBinder.Eval(Container.DataItem,"SKUNumber")%></span>
<div class="desc">
<%# Eval("SKUDescription")%>
</div>
<div class="productlinks">
<ul>
<%# (Eval("RMRFile1") != null && Eval("RMRFile1") != "") ? "<li>" + CMSCustom.GetFileLink(Eval("RMRFile1").ToString(), Eval("SKUID").ToString()) + "</li>" : ""%>
<%# (Eval("RMRFile2") != null && Eval("RMRFile2") != "") ? "<li>" + CMSCustom.GetFileLink(Eval("RMRFile2").ToString(), Eval("SKUID").ToString()) + "</li>" : ""%>
<%# (Eval("RMRFile3") != null && Eval("RMRFile3") != "") ? "<li>" + CMSCustom.GetFileLink(Eval("RMRFile3").ToString(), Eval("SKUID").ToString()) + "</li>" : ""%>
</ul>
</div>
<div class="lower">
<dl>
<dt>Expiry:</dt>
<dd>
<strong>
<%# String.Format("{0:dd-MMM-yyyy}",ValidationHelper.GetDateTime(Eval("OrderItemAccessExpiry"),DateTime.Now))%>
</strong>
</dd>
<dt>Price:</dt>
<dd>
<strong>
<%# EcommerceFunctions.GetFormatedPrice(Eval("SKUPrice")) %>
</strong>
</dd>

</dl>
<asp:PlaceHolder ID="plcSubscription" runat="server" Visible="false">
<h4>Subscription</h4>
<ul>
<asp:PlaceHolder ID="plcSubscriptionEnd" runat="server">
<li>Subscription cancelled date:<asp:Literal ID="litEndDate" runat="server"></asp:Literal></li>
<li>Reason:<asp:Literal ID="litEndReason" runat="server"></asp:Literal></li>
</asp:PlaceHolder>
</ul>
<asp:Button ID="btnCancelSubscription" runat="server" OnClick="CancelSubscription" Text="Cancel Subscription" />

<asp:Literal ID="litCancelResult" runat="server"></asp:Literal>
</asp:PlaceHolder>
</div>
</div>
</asp:PlaceHolder>
<asp:PlaceHolder ID="plcExpired" runat="server" Visible="true">

<div class="entry">
<h2><%# Eval("SKUName")%></h2>
<span class="serial"><%# DataBinder.Eval(Container.DataItem,"SKUNumber")%></span>
<div class="desc">
<%# Eval("SKUDescription")%>
</div>

<div class="lower">
<dl>
<dt>Expired:</dt>
<dd>
<strong>
<%# String.Format("{0:dd-MMM-yyyy}",ValidationHelper.GetDateTime(Eval("OrderItemAccessExpiry"),DateTime.Now))%>
</strong>
</dd>
</dl>
</div>
</div>
</asp:PlaceHolder>
</ItemTemplate>
</asp:Repeater>

</div>
</asp:PlaceHolder>

User avatar
Member
Member
michael.hargreaves-roymorgan - 2/11/2010 6:08:21 PM
   
RE:problems creating new web part layout.

I've gotten this to work, I can see what you were getting at now with changing the codefile name.

Maybe this was just how the intial developers set this up.

Thanks alot for the help.
Michael.