Skip to content

Instantly share code, notes, and snippets.

@sachatrauwaen
Last active August 29, 2015 14:03
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 sachatrauwaen/94766e406e05671a643c to your computer and use it in GitHub Desktop.
Save sachatrauwaen/94766e406e05671a643c to your computer and use it in GitHub Desktop.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyConfigurator.ascx.cs" Inherits="Providers_TokenProviders_My_MyConfigurator" %>
<div class="dnnFormItem">
<asp:label id="lblField" runat="server" text="Parameter" helptext="Enter a value"
controlname="tbParameter" CssClass="dnnLabel" />
<asp:TextBox ID="tbParameter" runat="server"></asp:TextBox>
</div>
using Satrabel.OpenBlocks.Token;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Providers_TokenProviders_My_MyConfigurator : TokenConfigurator
{
protected void Page_Load(object sender, EventArgs e)
{
}
public override void LoadSettings(System.Collections.Hashtable settings)
{
try
{
tbParameter.Text = (string)settings["parameter"];
}
catch (Exception)
{
}
}
public override System.Collections.Hashtable SaveSettings()
{
Hashtable settings = new Hashtable();
settings["parameter"] = tbParameter.Text;
return settings;
}
public override string getToken()
{
return "{{my parameter=\""+tbParameter.Text+"\" }}";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment