net web pages,in the first one, I wrote like below:

protected void lbXML_Click(object sender, EventArgs e)
{
    HttpCookie cookie = new HttpCookie("RequestedXML");
    cookie["xmlContent"] = hide_XML.Value;
    Response.Cookies.Add(cookie);
    cookie.Expires = DateTime.Now.AddMinutes(20);
    Response.Write("<script>window.open('XML_Editor.aspx', '_blank', 'toolbar=no, location=no, resizable=yes, width=800px, height=500px', true);</script>");
}

In XML_Editor.aspx, I wrote code like this:

protected void Page_Load(object sender, EventArgs e)
{
    Page lastPage = (Page)Context.Handler;
    if (!IsPostBack)
    {

        HttpCookie cookie = Request.Cookies["RequestedXML"];
        if (cookie != null)
        {
            TextBox1.Text = cookie["xmlContent"];
        }

    }
}

the problem is that the cookie always return null to me in Page_Load in XML_Editor.aspx, why is that?

Related posts

Recent Viewed