Tech Off Thread

9 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Please Help me as you can

Back to Forum: Tech Off
  • User profile image
    Daffy_Duck

     By ASP.net I wanna to
    post more than one variable with response.redirect
    how i can do that


    I Tested that but it doesn't work

    Response.Redirect("Test.aspx?" & Var1, Var2, Var3)

    Or

    Response.Redirect("Test.aspx?" & Var1 & Var2 & Var3)

  • User profile image
    jmbledsoe

    Hmm...I'm not sure that's possible.  A Response.Redirect can never POST anything; it's always a GET request.

    Now, if you want to put more than one variable on your URL, you do it this way:

    http://www.someurl.com/Default.aspx?var1=10&var2=20

    This will call Default.aspx with two parameters:

    var1 = 10
    var2 = 20

    I hope that helps! Smiley

    -- John B.
    http://johnsbraindump.blogspot.com

  • User profile image
    Daffy_Duck

    i'll try this thank you sooo much

  • User profile image
    Daffy_Duck

    What if i wanna to get the value of Var1 and Var2 from the page????????



    I mean  insted of
         Var1=10
         Var2=20
    I wanna
         Var1= XXX
         Var2=YYY

  • User profile image
    Daffy_Duck

    Please any one help me i need it soo much[C]

  • User profile image
    cpod

    Have a look at Request.QueryString

    something along the lines of the following in the Page_Load event

    Var1 = Request.QueryString("var1")
    Var2 = Request.QueryString("var2")

  • User profile image
    jmbledsoe

    I think you need something like this:

    (Assume that value1 and value2 are fields/variables on your page.)

    Response.Redirect(String.Format("Test.aspx?var1={0}&var2={1}", value1, value2))

  • User profile image
    Daffy_Duck

    Thank you your code did it thanks sooooooooooooooooooo much

  • User profile image
    Maurits

    jmbledsoe wrote:
    Response.Redirect(String.Format("Test.aspx?var1={0}&var2={1}", value1, value2))


    Minor nitpick... need to UrlEncode value1 and value2


    Response.Redirect(String.Format("Test.aspx?var1={0}&var2={1}", UrlEncode(value1), UrlEncode(value2)))

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.