Skip to content

Instantly share code, notes, and snippets.

@tonnguyen
Created February 4, 2020 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonnguyen/e925109c9ea4632b1051fea00586d915 to your computer and use it in GitHub Desktop.
Save tonnguyen/e925109c9ea4632b1051fea00586d915 to your computer and use it in GitHub Desktop.
WebForms panel in L7.4
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SamplePanel.ascx.cs" Inherits="Litium.Accelerator.Mvc.Site.ECommerce.Panels.SamplePanel" %>
<h1 runat="server" id="Heading"></h1>
using System;
namespace Litium.Accelerator.Mvc.Site.ECommerce.Panels
{
public partial class SamplePanel : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
Heading.InnerText = "Hello world " + Guid.NewGuid().ToString("N");
}
}
}
using Litium.Foundation.Modules.ECommerce;
using Litium.Web.Administration.Panels;
namespace Litium.Accelerator.Mvc.Site.ECommerce.Panels
{
/// <summary>
/// Defines panel definition, to display it in EcommerceArea.
/// </summary>
public class SamplePanelDefinition : PanelDefinitionBase<EcommerceArea, SamplePanelDefinition.SettingsModel>
{
/// <summary>
/// Points to the path of SamplePanelPage.aspx
/// </summary>
public override string Url => "https://localhost/Site/ECommerce/Panels/SamplePanelPage.aspx";
public override string ComponentName => null;
public override bool PermissionCheck()
{
return true;
}
public class SettingsModel : IPanelSettings
{
}
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SamplePanelPage.aspx.cs" Inherits="Litium.Accelerator.Mvc.Site.ECommerce.Panels.SamplePanelPage" %>
<%@ Register src="SamplePanel.ascx" tagname="SamplePanel" tagprefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<%-- Render panel's web user control --%>
<uc1:SamplePanel ID="SamplePanel1" runat="server" />
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment