[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Responce.Rederect with a session variable

Posted on 2011-09-16
2
Medium Priority
?
308 Views
Last Modified: 2012-05-12
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))
        {
            response.Redirect(url);
        }
        else
        {
            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 = @"window.open(""{0}"", ""{1}"", ""{2}"");"; }
            else { script = @"window.open(""{0}"", ""{1}"");"; }
            script = String.Format(script, url, target, windowFeatures);
            ScriptManager.RegisterStartupScript(page, typeof(Page), "Redirect", script, true);
        }
        return;
    }
}



      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;
using ParkAttachmentDll.edu.park.captain;

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

0
Comment
Question by:HawaiiDragon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 60

Accepted Solution

by:
HainKurt earned 2000 total points
ID: 36549939
you are already passing it to url, so ignore session use

testinglablesession.Text = Request["ID"]

or

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


0
 

Author Closing Comment

by:HawaiiDragon
ID: 36549967
Anddd......... YOU ROCK!!!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question