Hi,
What you could do is set a prefix in the tabmodule settings and in your pagebehind code just set the prefix to a public string and include in this prefix in your CssClass of yur ascx file. You would need to create a module control (under host--> module definitions --> your module) with Settings as key and type being Edit and point it to your settings ascx file. Your code behind (C# version) could include within the namespace tag:
partial class Settings : ModuleSettingsBase
{
public override void LoadSettings()
{
try
{
if (Page.IsPostBack == false)
{
if (!(TabModuleSettings["currency"] == null))
{
txtClassPrefix.Text = (string)TabModuleSettings["classprefix"];
}
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
public override void UpdateSettings()
{
try
{
ModuleController objModules = new ModuleController();
objModules.UpdateTabModuleSetting(TabModuleId, "classprefix", txtClassPrefix.Text);
SynchronizeModule(); //(don't remeber if this is depreciated though)
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}}}
and of course have a textbox in your ascx file named txtClassPrefix.
In your module you could then (in the code behind) use something like:
....
public string classPrefix;
....
and in your page_load:
.....
if (!(Settings["classprefix"]==null))
{
classPrefix = (string)Settings["classprefix"];
}
else
{
classPrefix = some default value;
}
....
and to use the style in your ascx file just use:
<asp:label id=someid runat=server CssClass="<%=ClassPrefix%>Myclass"
Just create an entry in your css file for each prefix and class combi and you'r done.
Hth
Alexander