using SteamWare; using System; using System.Web.UI; public partial class mod_righePag : System.Web.UI.UserControl { /// /// indicato (nuovo) numero righe x pagina /// public event EventHandler eh_newNum; /// /// caricamento pagina /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { numRowReq = numRowPag; } } /// /// UID formattato con "_" /// public string uid { get { // fix brutale: nelle pagine master c'è un ctl00_ iniziale di troppo... return this.UniqueID.Replace("$", "_").Replace("ctl00_", "").Replace("ctl01_", ""); } } /// /// effettua traduzione del lemma /// /// /// public string traduci(string lemma) { return user_std.UtSn.Traduci(lemma); } /// /// aggiorno controllo paginazione... /// /// /// protected void txtNumRighe_TextChanged(object sender, EventArgs e) { // salvo num righe... numRowPag = numRowReq; // sollevo evento nuovo valore... if (eh_newNum != null) { eh_newNum(this, new EventArgs()); } } /// /// numero righe per pagina (in sessione) /// public int numRowPag { get { int answ = 10; try { answ = memLayer.ML.IntSessionObj("numRowPag_" + uid); //if (answ == 0) answ = 10; } catch { answ = 10; } return answ; } set { memLayer.ML.setSessionVal("numRowPag_" + uid, value); numRowReq = value; } } /// /// numero righe gridview da mostrare legato a controllo textbox /// protected int numRowReq { get { int answ = numRowPag; try { answ = Convert.ToInt32(txtNumRighe.Text.Trim()); if (answ == 0) { answ = numRowPag; txtNumRighe.Text = answ.ToString(); } } catch { } return answ; } set { txtNumRighe.Text = value.ToString(); } } }