first of all I would like to wish everyone a happy 2015 and be prosperous for all of you. I would like to help me with a problem I have with a cookie and Winnovative, the problem is that I correctly the data in a cookie but when the process for the dll and reaches the window that gets data to the cookie comes in white with no data. not then I'm doing wrong. Annex code to Confinued:
string apo = String.Empty;
apo = Request.Cookies["dApoderados"].Value;
HttpCookie datosApoderados = new HttpCookie("datosApoderados");
string cadenaPDF = String.Empty;
string ruta = String.Empty;
ruta = ObtenerDireccionInformeSalida();
ruta = ruta.Replace("../", "");
GenerarQueryString();
Response.Cookies["datosApoderados"].Value = apo;
ruta = "http://localhost:10458/" + ruta;
byte[] bytes = ObtenerPdfBytes(ruta);
That's when I want to process, then passes through an intermediate product which is:
public byte[] ObtenerPdfBytes(string ruta)
{
string datosClientes = Request.Cookies["datosCliente"].Value;
string datosApoderados = Request.Cookies["datosApoderados"].Value;
datosClientes = "?DATOS=" + datosClientes;
ruta = ruta + datosClientes;
PdfConverter pdfConverter = new PdfConverter();
HttpCookie prueba = new HttpCookie("prueba");
Response.Cookies["prueba"].Value = datosApoderados;
if (Context.Request.Cookies[FormsAuthentication.FormsCookieName] != null)
{
pdfConverter.HttpRequestHeaders = String.Format("prueba : {0}={1}",
FormsAuthentication.FormsCookieName, Request.Cookies[FormsAuthentication.FormsCookieName].Value);
}
pdfConverter.LicenseKey = ClaveGeneradorPdf;
pdfConverter.PdfDocumentOptions.ShowFooter = true;
pdfConverter.PdfFooterOptions.PageNumberText = TextoPagina;
pdfConverter.PdfFooterOptions.PageNumberTextFontType = PdfFontType.HelveticaBold;
pdfConverter.PdfFooterOptions.PageNumberTextFontSize = 8;
pdfConverter.PdfFooterOptions.ShowPageNumber = true;
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.Legal;
pdfConverter.PdfFooterOptions.FooterHeight = AltoPie;
pdfConverter.PdfDocumentOptions.LeftMargin = MargenIzquierdo;
pdfConverter.PdfDocumentOptions.RightMargin = MargenDerecho;
pdfConverter.PdfDocumentOptions.TopMargin = MargenSuperior;
pdfConverter.PdfDocumentOptions.BottomMargin = MargenInferior;
pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
pdfConverter.PdfFooterOptions.FooterText = "texto";
pdfConverter.PdfFooterOptions.FooterTextFontType = PdfFontType.HelveticaBold;
pdfConverter.PdfFooterOptions.FooterTextFontSize = 8;
pdfConverter.PdfDocumentOptions.ShowHeader = false;
byte[] pdfBytes = pdfConverter.GetPdfBytesFromUrl(ruta);
return pdfBytes;
}
when I get to the next line is where the cookie is lost: byte [] pdfBytes = pdfConverter.GetPdfBytesFromUrl (path);
public override void Pagina_PrimeraCarga(object sender, EventArgs e)
{
string prueba = Request.Cookies["prueba"].Value;
string datosRequest = Request.QueryString["DATOS"];
char delimitadores = ';';
string[] datos = datosRequest.Split(delimitadores);
imgBanco.Attributes.Add("ImageUrl", "~/App_Themes/Imagenes/Logo.gif");
DateTime fechaHoy = DateTime.Now;
lblDia.Text = Convert.ToString(fechaHoy.Day);
lblMes.Text = Convert.ToString(fechaHoy.Month);
lblAno.Text = Convert.ToString(fechaHoy.Year);
loading data from the cookie in the latter code: string test = Request.Cookies ["test"] Value.; This goes empty and no data