November Happy Hour will be moved to Thursday December 5th.
I'd like to access methods from a subBlock, as it was possible before with the CMS 6 without the blocks because we were using UserControls.
Here's some code to explain myself:
SubBlock.ascx.cs =>
----------------------------------------------------------------------------------------------
public partial class SubBlock: BlockControlBase<SubBlockBlock>{
public string Method1() { return "A string"; }
}
ParentBlock.ascx =>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ParentBlock.ascx.cs" Inherits="MyProject.Views.Blocks.ParentBlock" %>
<div> <EPiServer:Property ID="SubBlock" runat="server" PropertyName="SubBlock" /></div>
ParentBlock.ascx.cs =>
public partial class ParentBlock: BlockControlBase<ParentBlockBlock>{
public string ParentMethod() { string aStringToDoSomething = SubBlock.Method1(); } //This of course doesn't work
How can I do something like calling a method on a subBlock, any ideas?
I'd like to access methods from a subBlock, as it was possible before with the CMS 6 without the blocks because we were using UserControls.
Here's some code to explain myself:
SubBlock.ascx.cs =>
----------------------------------------------------------------------------------------------
public partial class SubBlock: BlockControlBase<SubBlockBlock>
{
public string Method1() { return "A string"; }
}
----------------------------------------------------------------------------------------------
ParentBlock.ascx =>
----------------------------------------------------------------------------------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ParentBlock.ascx.cs" Inherits="MyProject.Views.Blocks.ParentBlock" %>
<div>
<EPiServer:Property ID="SubBlock" runat="server" PropertyName="SubBlock" />
</div>
----------------------------------------------------------------------------------------------
ParentBlock.ascx.cs =>
----------------------------------------------------------------------------------------------
public partial class ParentBlock: BlockControlBase<ParentBlockBlock>
{
public string ParentMethod() { string aStringToDoSomething = SubBlock.Method1(); } //This of course doesn't work
}
----------------------------------------------------------------------------------------------
How can I do something like calling a method on a subBlock, any ideas?