ASPX templates
Version 7.x > ASPX templates > How to stop execution of InlineUserControls inside editableregions when visible = false? View modes: 
User avatar
Member
Member
allan.tan-gmail - 6/28/2013 4:53:17 AM
   
How to stop execution of InlineUserControls inside editableregions when visible = false?
Does anyone knows how to disable / stop the execution of inline controls when the editable region is hidden (visible=false)?

Example code on aspx:

<cms:CMSEditableRegion ID="CMSEditableRegion1" DialogHeight="200" DialogWidth="900" RegionType="HtmlEditor" RegionTitle="Content for User A" runat="server" />
<cms:CMSEditableRegion ID="CMSEditableRegion2r" DialogHeight="200" DialogWidth="900" RegionType="HtmlEditor" RegionTitle="Content for User B" runat="server" />
<cms:CMSEditableRegion ID="CMSEditableRegion3" DialogHeight="200" DialogWidth="900" RegionType="HtmlEditor" RegionTitle="Content for User C" runat="server" />


Code in aspx.cs (Page Load):

if (true)
{
CMSEditableRegion1.Visible = true;
CMSEditableRegion2.Visible = false;
CMSEditableRegion3.Visible = false;
}


Inside the EditableRegions (1,2,3) there are different InlineUserControls. When EditableRegions 2 and 3 are set to visible = false, how to stop the execution of the InlineUserControls insite EditableRegions 2 and 3?


User avatar
Kentico Support
Kentico Support
kentico_romank - 7/1/2013 7:28:13 AM
   
RE:How to stop execution of InlineUserControls inside editableregions when visible = false?
Hi,

I did this in the following way. First I have created simple inline control and inside ShowTime.ascx i put the following code:
<asp:Panel ID="Panel" runat="server">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</asp:Panel>
and inside ShowTime.ascx.cs i put
if (Panel.Visible = true)
{
Label1.Text = "hello";
}
So that means it will we be executed only when you have set visible.true for the specific editable region.

I hope it is understandable and will work for you.

Rest Regards,
Roman Konicek