Files
C2P/C2P/WebUserControls/mod_testata.ascx.cs
T
Samuele E. Locatelli e78c060a22 update header x selezione pagina
altri udpate x gestioen nuovo recortd STD
2014-04-17 14:42:00 +02:00

79 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
namespace C2P.WebUserControls
{
public partial class mod_testata : System.Web.UI.UserControl
{
///// <summary>
///// nome della pagina correntemente caricata
///// </summary>
//public string _paginaCorrente;
///// <summary>
///// memorizza la pagina precedente (ovvero la corrente ma non da page-object ma in session...
///// </summary>
//public string _paginaPrecedente;
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
PagCorrente();
}
}
public string liClass(string nomeElem)
{
string answ = "";
if (user_std.pagCorrente != "")
{
try
{
if (nomeElem.IndexOf(user_std.pagCorrente) >= 0) answ = "active";
}
catch
{ }
}
//else
//{
// try
// {
// if (nomeElem == "default") answ = "active";
// }
// catch
// { }
//}
return answ;
}
/// <summary>
/// salva in variabile pagina il nome della pagina corrente
/// </summary>
protected void PagCorrente()
{
Uri MyUrl = Request.Url;
string delimStr = "/";
char[] delimiter = delimStr.ToCharArray();
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
int n = finalUrl.Length;
user_std.pagCorrente = finalUrl[n - 1].ToString();
user_std.pagPrecedente = Request.Url.ToString();
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
}
}