protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current.Request.HttpMethod == "POST")
            {
                string cod_bpin = "";
                string outTxt   = "";

                NameValueCollection pColl = Request.Params;
                if (pColl.AllKeys.Contains("cod_bpin"))
                {
                    cod_bpin = Request.Params.GetValues("cod_bpin")[0].ToString();
                }

                AuditoriasCiudadanas.Controllers.AudienciasController datos = new AuditoriasCiudadanas.Controllers.AudienciasController();
                outTxt = datos.obtValoracionProyecto(cod_bpin);
                string[]             separador = new string[] { "<||>" };
                var                  result    = outTxt.Split(separador, StringSplitOptions.None);
                Controllers.PrintPDF pdf       = new Controllers.PrintPDF();

                Response.ClearContent();
                Response.ClearHeaders();
                Response.ContentType = "application/pdf";
                Response.AddHeader("Content-Disposition", "Attachment;filename=ValoracionProyecto.pdf");
                Response.BinaryWrite(pdf.htmlPDF(result[0]).ToArray());
                Response.End();
                Response.Flush();
                Response.Clear();
            }
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (HttpContext.Current.Request.HttpMethod == "POST")
     {
         NameValueCollection pColl = Request.Params;
         //string nombre,string email,string celular,string hash_clave,int idperfil,int id_departamento,int id_municipio
         //HttpContext.Current.Request.RequestType
         if (pColl.AllKeys.Contains("nombre"))
         {
             Controllers.PrintPDF pdf = new Controllers.PrintPDF();
             pdf.htmlPDF(null, Request.PhysicalPath + "//" + pColl.Get("nombre").ToString(), "<h1>basico</h1>");
         }
     }
 }