protected void Page_Load(object sender, EventArgs e) { string strScript = ""; bool blnDebugSession = false; Departamento objDepartamento = new Departamento(); Rol objRol = new Rol(); Usuario objUsuario = new Usuario(); try { if (!this.IsPostBack) { this.ddlDepartamento.DataSource = objDepartamento.ObtenerCatalogo(); this.ddlDepartamento.DataTextField = "Descripcion"; this.ddlDepartamento.DataValueField = "idDepartamento"; this.ddlDepartamento.DataBind(); this.ddlDepartamento.Items.Insert(0, ""); this.ddlRol.DataSource = objRol.ObtenerCatalogo(); this.ddlRol.DataTextField = "Descripcion"; this.ddlRol.DataValueField = "idRol"; this.ddlRol.DataBind(); this.ddlRol.Items.Insert(0, ""); this.ddlUser.DataSource = objUsuario.ObtenerCatalogo(); this.ddlUser.DataTextField = "vNombre"; this.ddlUser.DataValueField = "idUsuario"; this.ddlUser.DataBind(); this.ddlUser.Items.Insert(0, ""); } //Verifico el lenguaje if (UICulture.ToString().ToUpper().IndexOf(ConfigurationManager.AppSettings["CaracterUICultura"].ToString()) > 0) { this.hidEsEnEspanol.Value = "true"; } else { this.hidEsEnEspanol.Value = "false"; } // Veo variables de session: blnDebugSession = Convert.ToBoolean(ConfigurationManager.AppSettings["SessionDebug"]); if (blnDebugSession) { Session["userIDInj"] = "1"; Session["usernameInj"] = "Admin"; } } catch (Exception ex) { strScript = "Error: " + ex.Message.ToString().Replace("'", "").Replace("\n", "\\n").Replace("\r", "\\n").Replace(Convert.ToString((char)10), "\\n").Replace(Convert.ToString((char)13), "\\n"); } finally { if (strScript != "") { strScript = "<script language='javascript'> alert('" + strScript + "');</script>"; System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Error", strScript, false); } } }