Vinz' Blog

"Code, Beer and Music" ~ my way of being a programmer!
posts - 123, comments - 343, trackbacks - 0

My Links

News

Archives

Image Galleries

Passing Multiple Querystring values with Response.Redirect method

Here's an example on how to pass Multiple querystrings in the page..

Page1

protected void Button1_Click(object sender, EventArgs e)
{
        string strName = "VINZ";
        string strAddress = "CEBU";
        string strDate = DateTime.Now.ToShortDateString();
        Response.Redirect(string.Format("TestNasad2.aspx?param1={0}&param2={1}&param3={2}",strName,strAddress,strDate));

}

The on Page2 you can get each values this way below

protected void Page_Load(object sender, EventArgs e)
{
        if ((Request.QueryString["param1"] != null && Request.QueryString["param2"] != null) && Request.QueryString["param3"] != null)
        {
            string name = Request.QueryString["param1"];
            string address = Request.QueryString["param2"];
            string date = Request.QueryString["param3"];

        }
}

Hope this Helps!

Print | posted on Friday, September 12, 2008 1:40 AM |

Feedback

Gravatar

# re: Passing Multiple Querystring values with Response.Redirect method

Its good
10/25/2008 10:45 PM | Sujit
Gravatar

# re: Passing Multiple Querystring values with Response.Redirect method

Hi,

Thanks for your code.It definatesly help me lot.
2/26/2009 10:05 PM | Samrat Dutta
Gravatar

# re: Passing Multiple Querystring values with Response.Redirect method

Hi,

Thanks for your code.It definately help me lot.
2/26/2009 10:05 PM | Samrat Dutta
Gravatar

# re: Passing Multiple Querystring values with Response.Redirect method

Still having problems!!!! params are capturing the data!!!!
5/9/2009 11:31 PM | harris
Gravatar

# re: Passing Multiple Querystring values with Response.Redirect method

Hi Harris,

Could you please elaborate more on your issues? what do you mean by "params are capturing data"?
5/10/2009 1:41 AM | Vinz
Gravatar

# re: Passing Multiple Querystring values with Response.Redirect method

thanks !!!
9/27/2009 10:16 AM | Marvel
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: