Пример #1
0
    void ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)
    {
        PreRutaBC preruta = new PreRutaBC();

        callbackReturnValue = muestraproceso(preruta.obtenerultimosprocesos());
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsCallback)
        {
            return;
        }
        else
        {
            PreRutaBC preruta = new PreRutaBC();
            string    procesos;
            procesos = muestraproceso(preruta.obtenerultimosprocesos());

            if (procesos != "")
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "muestraproceso", "ClientNameCallback('" + procesos + "');", true);
            }
        }


        if (Session["Usuario"] == null)
        {
            Response.Redirect("~/Inicio.aspx");
        }
        UsuarioBC user       = (UsuarioBC)Session["Usuario"];
        bool      autorizado = false;
        string    nombrepag  = this.Page.AppRelativeVirtualPath;

        nombrepag = nombrepag.Substring(nombrepag.LastIndexOf("/") + 1);
        //if (nombrepag.ToLower() != "inicio.aspx")
        //{
        //    foreach (MenuBC m in user.USUARIO_TIPO.MENU)
        //    {
        //        if (m.MENU_LINK == nombrepag)
        //        {
        //            autorizado = true;
        //            break;
        //        }
        //    }
        //    if (!autorizado)
        //        Response.Redirect("~/Inicio.aspx");
        //}

        //   txtClientID.Attributes.Add("onchange", "GetClientNameById('id|' + this.value, 'id');");


        if (IsPostBack == false)
        {
            ParametroBC param = new ParametroBC();
            DataTable   datos = param.ObtenerTodo();
            Session["parametros"] = datos;
            int contador = 0;
            while (contador < datos.Rows.Count)
            {
                HiddenField hf = new HiddenField();
                hf.ID    = "param_" + datos.Rows[contador]["para_nombre"].ToString();
                hf.Value = datos.Rows[contador]["para_valor"].ToString();
                this.parametros.ContentTemplateContainer.Controls.Add(hf);
                contador = contador + 1;
            }
        }
        string callBackClientID = Page.ClientScript.GetCallbackEventReference(this, "arg", "ClientNameCallback", "context", "ClientNameCallbackError", true);
        string clientIDfunction = "function GetClientNameById(arg,context) { " + callBackClientID + "; }";

        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "GetClientNameById", clientIDfunction, true);
//        txtClientName.Attributes.Add("onchange", "GetClientIdByName('name|' + this.value, 'name');");
        //string callBackClientName = Page.ClientScript.GetCallbackEventReference(this, "arg", "ClientIdCallback", "context", "ClientIdCallbackError", true);
        //string clientNamefunction = "function GetClientIdByName(arg, context) { " + callBackClientName + "; }";
        //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "GetClientIdByName", clientNamefunction, true);
    }