Responce.Rederect with a session variable

Hello all I have a doosie for you.

I have a ascx page and once the user clicks a button it needs to go to a seprate popup page for the download to take place. NOW here is my problem in doing a test run I created a session variable bassed off of the ID in a DDL. I can flollow it in debug mode and it will hit the pop up page but the session variable is not populating in the page. Any ideas??? below is my code.
public static class ResponseHelper
    public static void Redirect(this HttpResponse response, string url, string target, string windowFeatures)
        if ((String.IsNullOrEmpty(target) || target.Equals("_self", StringComparison.OrdinalIgnoreCase)) && String.IsNullOrEmpty(windowFeatures))
            Page page = (Page)HttpContext.Current.Handler;
            if (page == null)
                throw new InvalidOperationException("Cannot redirect to new window outside Page context.");
            url = page.ResolveClientUrl(url);
            string script;
            if (!String.IsNullOrEmpty(windowFeatures))
            { script = @"""{0}"", ""{1}"", ""{2}"");"; }
            else { script = @"""{0}"", ""{1}"");"; }
            script = String.Format(script, url, target, windowFeatures);
            ScriptManager.RegisterStartupScript(page, typeof(Page), "Redirect", script, true);

      protected void Button2_Click(object sender, EventArgs e)
            Response.Redirect("/ics/Portlets/CUS/ICS/PARK_GradeAppeal_v1_5_27_2011/Downloads.aspx?ID=" + Session["SessionParkID"].ToString(), "_PDF", "menubar=0,width=100,height=100");


Open in new window

using System;
using Jenzabar.Common;
using Jenzabar.Portal.Framework;
using Jenzabar.Portal.Framework.Configuration;
using Jenzabar.Portal.Framework.Data;
using Jenzabar.Portal.Framework.Web;
using Jenzabar.Portal.Framework.Web.UI;
using Jenzabar.Portal.Framework.Preferences;
using Jenzabar.Portal.Framework.Security.Authorization;
using Jenzabar.Common.Web.UI.Controls;
using System.Collections.Generic;
using System.Data;
using System.Data.Odbc;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using ParkSendEmail_v1_11_16_2007;
using System.Web.UI.WebControls;
using System.Web.ApplicationServices;
using System.Web.ClientServices;
using System.Web.UI.HtmlControls;
using ParkAttachmentDll;
using System.IO;

namespace PARK_GradeAppeal_v1_5_27_2011
    public partial class Downloads : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
        testinglablesession.Text = (string)Session["SessionParkID"];


Open in new window

Who is Participating?
HainKurtConnect With a Mentor Sr. System AnalystCommented:
you are already passing it to url, so ignore session use

testinglablesession.Text = Request["ID"]


testinglablesession.Text = Request.QueryString["ID"];

HawaiiDragonAuthor Commented:
Anddd......... YOU ROCK!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.