-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.master.cs
executable file
·28 lines (24 loc) · 1.06 KB
/
Main.master.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Main : System.Web.UI.MasterPage
{
PedidosDataContext pedidos = new PedidosDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (HttpContext.Current.Session["nombreUsuario"] == null)
{
Response.Redirect("Login.aspx");
System.Web.UI.HtmlControls.HtmlGenericControl alerta =new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
alerta.ID = "alertaDiv";
alerta.InnerHtml = "Su tiempo de sesión ha expirado";
alerta.Attributes["class"] = "alert alert-red";
this.Controls.Add(alerta);
}
lblnombreUsuario.Text = (HttpContext.Current.Session["nombreUsuario"].ToString() +" "+ HttpContext.Current.Session["apellidoUsuario"].ToString());
lblmailUsuario.Text = HttpContext.Current.Session["emailUsuario"].ToString();
}
}