Input type Submit?

Discussion in 'ASP .Net' started by magic kat, Aug 2, 2007.

  1. magic kat

    magic kat Guest

    What's the equivalent in asp.net for the old "form method=post" using the
    submit. I want to redirect to another page with parameters, but I don't
    want the parameters to be displayed in the url. So I want to pass
    ClientName and ClientCompany to
    www.mySite.com\p.asp?ClientName=John&ClientCompany="JDCo"

    but I only want to display in the address bar www.mySite.com/p.asp
    magic kat, Aug 2, 2007
    #1
    1. Advertising

  2. magic kat

    dotnet_coder Guest

    There are several ways to do this. One way is, put a ASP.NET Button
    control on your page and then in the click event you could create
    sessions and assign the parameters to the sessions. Then you would
    response.redirect to the new page and check for the sessions.

    Here is example code for the button click event (in C#):

    --------
    Session["MyParam1"] = "Hello";
    Session["MyParam2"] = "World";

    Response.Redirect("p.asp");
    ----------


    Then to read the parameters on the receiving page you would do the
    following to write them out on the screen:

    ----------------
    string sParam1 = Session["MyParam1"].ToString();
    string sParam2 = Session["MyParam2"].ToString();

    Response.Write(sParam1 + " " + sParam2);
    ----------------

    Result on Screen: Hello World
    dotnet_coder, Aug 3, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marco Maroni
    Replies:
    2
    Views:
    1,632
    SteveWestbrook
    Apr 17, 2009
  2. Guy
    Replies:
    5
    Views:
    2,810
    brucie
    Dec 13, 2003
  3. Tuan Pham-Barnes
    Replies:
    2
    Views:
    1,335
    Lenny Linux
    Nov 23, 2004
  4. Replies:
    3
    Views:
    154
  5. Obscurr

    onclick together with input type =submit

    Obscurr, Jul 3, 2003, in forum: Javascript
    Replies:
    3
    Views:
    228
    Martin Honnen
    Jul 3, 2003
Loading...

Share This Page