Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using capaLogicaNegocio;
- using System.IO;
- using System.Xml.Serialization;
- using System.Web.Security;
- namespace capaPresentacion
- {
- public partial class webLogin : System.Web.UI.Page
- {
- CL_Usuario usuario = new CL_Usuario();
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void Login_Authenticate(object sender, AuthenticateEventArgs e)
- {
- servicioAutenticacion.OperacionesClient servicio = new servicioAutenticacion.OperacionesClient();
- XmlSerializer serializador = new XmlSerializer(typeof(CL_Usuario));
- StringReader lector = new StringReader(servicio.validar(Login.UserName, Login.Password));
- CL_Usuario usu = (CL_Usuario)serializador.Deserialize(lector);
- if (usu != null)
- {
- Login.UserName = usu.Nombre + " " + usu.Apellido;
- e.Authenticated = true;
- Session["Usuario Valido"] = usu;
- //el redirect no funciona si no agrega la etiqueta <authorization> y <authentication> en el Web.Config
- FormsAuthentication.RedirectFromLoginPage(Login.UserName, false);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement