69 lines
2.2 KiB
C#
69 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using ETS_Data;
|
|
|
|
namespace ETS_WS.WebUserControls
|
|
{
|
|
public partial class mod_clipboard : System.Web.UI.UserControl
|
|
{
|
|
|
|
/// <summary>
|
|
/// UID formattato con "_"
|
|
/// </summary>
|
|
public string uid
|
|
{
|
|
get
|
|
{
|
|
// fix brutale: nelle pagine master c'è un ctl00_ iniziale di troppo...
|
|
return this.UniqueID.Replace("$", "_").Replace("ctl00_", "").Replace("ctl01_", "");
|
|
}
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
ClientScriptManager script = Page.ClientScript;
|
|
if (!script.IsClientScriptBlockRegistered(this.GetType(), "clipboard"))
|
|
{
|
|
string fullScript = "<span><script src=\"Scripts/lmcbutton.js\" type=\"text/javascript\"></script>";
|
|
script.RegisterClientScriptBlock(this.GetType(), "clipboard", fullScript);
|
|
}
|
|
if (!script.IsClientScriptBlockRegistered(this.GetType(), uid + "_clip"))
|
|
{
|
|
string fullScript = string.Format("<script type='text/javascript'>ShowLMCButton('{0}', '{1}', '', 'Scripts/lmcbutton.swf');</script></span>", text4copy, text4btn);
|
|
script.RegisterClientScriptBlock(this.GetType(), uid + "_clip", fullScript);
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// testo da passare a clipboard
|
|
/// </summary>
|
|
public string text4copy
|
|
{
|
|
get
|
|
{
|
|
return utils.obj.StringSessionObj(string.Format("{0}_text4copy", uid));
|
|
}
|
|
set
|
|
{
|
|
utils.obj.setSessionVal(string.Format("{0}_text4copy", uid), value);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// testo x button
|
|
/// </summary>
|
|
public string text4btn
|
|
{
|
|
get
|
|
{
|
|
return utils.obj.StringSessionObj(string.Format("{0}_text4btn", uid));
|
|
}
|
|
set
|
|
{
|
|
utils.obj.setSessionVal(string.Format("{0}_text4btn", uid), value);
|
|
}
|
|
}
|
|
}
|
|
} |