Skip to content

Instantly share code, notes, and snippets.

@PNergard
PNergard / Parse excel-file and generate html table
Last active November 22, 2018 15:40
A method that uses EPPlus to parse a excel-file and generate a html table. Link to EPPlus nuget page: https://www.nuget.org/packages/EPPlus/. I don't take any credit for the code since I found it on the web and have only slightly modified it. But it works and I think it's worth spreading.
private string ParseExcelFileAndGenerateHtmlTable(ExcelPackage xlPackage)
{
string html = "";
int workBooks = 0;
using (xlPackage)
{
var workbook = xlPackage.Workbook;
if (workbook != null)
{
using System.Collections.Generic;
using EPiServer.Core;
using EPiServer.Validation;
using EPiServer;
using AlloyDemoMVC.Models.Media;
namespace AlloyDemoMVC.Business
{
public class ImagePropertyValidator : IValidate<ContentData>
{
@PNergard
PNergard / LicensExpiryScheduledJob
Created October 4, 2015 20:55
A scheduled job that monitors the license expiry date for EPiServer CMS.
using System;
using System.Linq;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using EPiServer.Licensing;
using System.Security.Cryptography;
using EPiServer.Framework.Configuration;
using EPiServer.Licensing.RestrictionTypes;
using System.Net.Mail;
@PNergard
PNergard / Quality.aspx.
Created September 23, 2015 20:25
Overview of ContentArea AllowedTypesAttribute
<%@ Page Language="C#" AutoEventWireup="false" CodeFile="Quality.aspx.cs" Inherits="EPiServer.Templates.Alloy.Quality" %>
<%@ Import Namespace="Castle.MicroKernel.Registration" %>
<%@ Import Namespace="EPiServer.ClientScript.Events" %>
<%@ Import Namespace="System.Web.Management" %>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
using EPiServer;
using EPiServer.Core;
using EPiServer.Editor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI.WebControls;