HttpRequest parameter read

Discussion in 'ASP .Net' started by MuZZy, Apr 17, 2004.

  1. MuZZy

    MuZZy Guest

    Hello,

    I am developing a web application. If i call an aspx page with several
    parameters, is there a way to get access to parameter values by key? I am
    using C#

    E.g.

    void PageLoad(object sender, EventArgs e) {
    string album = Request.<???>("album");
    }

    And a call the page: http://mywebsite.com/pics.aspx?album=FirstAlbum.

    As i could see, it only provides methods to get a list of parameters and
    then loop thru them.
    Is there any direct way?

    PS Sorry for cross-posting, i wasn't sure either to post the question to C#
    or ASP.NET NG.

    Thank you,
    Andrey
     
    MuZZy, Apr 17, 2004
    #1
    1. Advertising

  2. MuZZy

    Guest Guest

    String album = Request.QueryString["album"];

    havent tried this, but should work

    Kalpesh
     
    Guest, Apr 17, 2004
    #2
    1. Advertising

  3. "MuZZy" <> wrote in
    news:tw3gc.9650$0b4.20257@attbi_s51:

    > Hello,
    >
    > I am developing a web application. If i call an aspx page with
    > several parameters, is there a way to get access to parameter
    > values by key? I am using C#
    >
    > E.g.
    >
    > void PageLoad(object sender, EventArgs e) {
    > string album = Request.<???>("album");
    > }
    >
    > And a call the page:
    > http://mywebsite.com/pics.aspx?album=FirstAlbum.
    >
    > As i could see, it only provides methods to get a list of
    > parameters and then loop thru them.
    > Is there any direct way?


    Andrey,

    string album = string.Empty;
    if (Request.Params["album"] != null)
    album = Request.Params["album"].ToString();


    Hope this helps.

    Chris.
    -------------
    C.R. Timmons Consulting, Inc.
    http://www.crtimmonsinc.com/
     
    Chris R. Timmons, Apr 17, 2004
    #3
  4. string album = Request.QueryString["album"];

    --
    Manohar Kamath
    Editor, .netWire
    www.dotnetwire.com


    "MuZZy" <> wrote in message
    news:tw3gc.9650$0b4.20257@attbi_s51...
    > Hello,
    >
    > I am developing a web application. If i call an aspx page with several
    > parameters, is there a way to get access to parameter values by key? I am
    > using C#
    >
    > E.g.
    >
    > void PageLoad(object sender, EventArgs e) {
    > string album = Request.<???>("album");
    > }
    >
    > And a call the page: http://mywebsite.com/pics.aspx?album=FirstAlbum.
    >
    > As i could see, it only provides methods to get a list of parameters and
    > then loop thru them.
    > Is there any direct way?
    >
    > PS Sorry for cross-posting, i wasn't sure either to post the question to

    C#
    > or ASP.NET NG.
    >
    > Thank you,
    > Andrey
    >
    >
     
    Manohar Kamath [MVP], Apr 17, 2004
    #4
    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. Greg Reevosh via .NET 247

    HTTPRequest and JAVA Servlet

    Greg Reevosh via .NET 247, Oct 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    593
    Greg Reevosh via .NET 247
    Oct 17, 2004
  2. Dino Chiesa [Microsoft]

    Re: HTTPRequest and JAVA Servlet

    Dino Chiesa [Microsoft], Oct 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    489
    Dino Chiesa [Microsoft]
    Oct 27, 2004
  3. Greg Reevosh via .NET 247

    HTTPRequest and JAVA Servlet

    Greg Reevosh via .NET 247, Oct 31, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    412
    Greg Reevosh via .NET 247
    Oct 31, 2004
  4. John Saunders

    Re: HTTPRequest and JAVA Servlet

    John Saunders, Nov 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    458
    John Saunders
    Nov 17, 2004
  5. Replies:
    0
    Views:
    1,442
Loading...

Share This Page