Storing structured types in request

Discussion in 'ASP .Net' started by Dharmesh, Jul 29, 2004.

  1. Dharmesh

    Dharmesh Guest

    Hi every1,

    I am learning ASP.NET and came accross problem of storing my classes object
    and I want its scope to be request. Is there a way do that. I found the only
    way to store structured values in with scope request was with ViewState, but
    for the ViewState to work the page has to post back to itself. But my page
    does not posts back.

    I would really appreciate your help.

    Thank you very much,

    Dharmesh
     
    Dharmesh, Jul 29, 2004
    #1
    1. Advertising

  2. Dharmesh

    Hans Kesting Guest

    "Dharmesh" <> wrote in message news:e$...
    > Hi every1,
    >
    > I am learning ASP.NET and came accross problem of storing my classes object
    > and I want its scope to be request. Is there a way do that. I found the only
    > way to store structured values in with scope request was with ViewState, but
    > for the ViewState to work the page has to post back to itself. But my page
    > does not posts back.
    >
    > I would really appreciate your help.
    >
    > Thank you very much,
    >
    > Dharmesh
    >
    >


    Are you sure you need "request" scope? It's not very long, from the moment the
    browser requests a url in your site to the moment the server is done processing it.
    Even if the generated page contains images, those are requested via new requests.

    You can add (private) variables to the page's codebehind that you can use during
    processing. No concurrence problems: every request to that page gets serviced
    by a new instance of this class.

    Hans Kesting
     
    Hans Kesting, Jul 29, 2004
    #2
    1. Advertising

  3. Dharmesh

    Dharmesh Guest

    Yes!! I need request scope. So do you mean to say there is no way?

    Dharmesh

    "Hans Kesting" <> wrote in message
    news:...
    >
    > "Dharmesh" <> wrote in message

    news:e$...
    > > Hi every1,
    > >
    > > I am learning ASP.NET and came accross problem of storing my classes

    object
    > > and I want its scope to be request. Is there a way do that. I found the

    only
    > > way to store structured values in with scope request was with ViewState,

    but
    > > for the ViewState to work the page has to post back to itself. But my

    page
    > > does not posts back.
    > >
    > > I would really appreciate your help.
    > >
    > > Thank you very much,
    > >
    > > Dharmesh
    > >
    > >

    >
    > Are you sure you need "request" scope? It's not very long, from the moment

    the
    > browser requests a url in your site to the moment the server is done

    processing it.
    > Even if the generated page contains images, those are requested via new

    requests.
    >
    > You can add (private) variables to the page's codebehind that you can use

    during
    > processing. No concurrence problems: every request to that page gets

    serviced
    > by a new instance of this class.
    >
    > Hans Kesting
    >
    >
     
    Dharmesh, Jul 29, 2004
    #3
  4. Dharmesh

    Scott Allen Guest

    Use the Items collection of HttpContext.

    I have an article with some discussion:

    The HttpContext Items Collection
    http://odetocode.com/Articles/111.aspx

    HTH,

    --
    Scott
    http://www.OdeToCode.com

    On Thu, 29 Jul 2004 11:16:33 -0500, "Dharmesh"
    <> wrote:

    >Yes!! I need request scope. So do you mean to say there is no way?
    >
    >Dharmesh
    >
    >"Hans Kesting" <> wrote in message
    >news:...
    >>
    >> "Dharmesh" <> wrote in message

    >news:e$...
    >> > Hi every1,
    >> >
    >> > I am learning ASP.NET and came accross problem of storing my classes

    >object
    >> > and I want its scope to be request. Is there a way do that. I found the

    >only
    >> > way to store structured values in with scope request was with ViewState,

    >but
    >> > for the ViewState to work the page has to post back to itself. But my

    >page
    >> > does not posts back.
    >> >
    >> > I would really appreciate your help.
    >> >
    >> > Thank you very much,
    >> >
    >> > Dharmesh
    >> >
    >> >

    >>
    >> Are you sure you need "request" scope? It's not very long, from the moment

    >the
    >> browser requests a url in your site to the moment the server is done

    >processing it.
    >> Even if the generated page contains images, those are requested via new

    >requests.
    >>
    >> You can add (private) variables to the page's codebehind that you can use

    >during
    >> processing. No concurrence problems: every request to that page gets

    >serviced
    >> by a new instance of this class.
    >>
    >> Hans Kesting
    >>
    >>

    >
     
    Scott Allen, Jul 29, 2004
    #4
  5. Dharmesh

    Dharmesh Guest

    Thank you very much scott. Your article gave me a good reference too. This
    is exactly what I needed.

    Thanks.

    Dharmesh

    "Scott Allen" <bitmask@[nospam].fred.net> wrote in message
    news:...
    > Use the Items collection of HttpContext.
    >
    > I have an article with some discussion:
    >
    > The HttpContext Items Collection
    > http://odetocode.com/Articles/111.aspx
    >
    > HTH,
    >
    > --
    > Scott
    > http://www.OdeToCode.com
    >
    > On Thu, 29 Jul 2004 11:16:33 -0500, "Dharmesh"
    > <> wrote:
    >
    > >Yes!! I need request scope. So do you mean to say there is no way?
    > >
    > >Dharmesh
    > >
    > >"Hans Kesting" <> wrote in message
    > >news:...
    > >>
    > >> "Dharmesh" <> wrote in message

    > >news:e$...
    > >> > Hi every1,
    > >> >
    > >> > I am learning ASP.NET and came accross problem of storing my classes

    > >object
    > >> > and I want its scope to be request. Is there a way do that. I found

    the
    > >only
    > >> > way to store structured values in with scope request was with

    ViewState,
    > >but
    > >> > for the ViewState to work the page has to post back to itself. But my

    > >page
    > >> > does not posts back.
    > >> >
    > >> > I would really appreciate your help.
    > >> >
    > >> > Thank you very much,
    > >> >
    > >> > Dharmesh
    > >> >
    > >> >
    > >>
    > >> Are you sure you need "request" scope? It's not very long, from the

    moment
    > >the
    > >> browser requests a url in your site to the moment the server is done

    > >processing it.
    > >> Even if the generated page contains images, those are requested via new

    > >requests.
    > >>
    > >> You can add (private) variables to the page's codebehind that you can

    use
    > >during
    > >> processing. No concurrence problems: every request to that page gets

    > >serviced
    > >> by a new instance of this class.
    > >>
    > >> Hans Kesting
    > >>
    > >>

    > >

    >
     
    Dharmesh, Jul 29, 2004
    #5
    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. Brian Birtle
    Replies:
    2
    Views:
    2,131
    John Saunders
    Oct 16, 2003
  2. Vince
    Replies:
    6
    Views:
    317
    Alipha
    Sep 1, 2005
  3. toton
    Replies:
    11
    Views:
    727
    toton
    Oct 13, 2006
  4. Jonathan Wood
    Replies:
    1
    Views:
    524
    Jonathan Wood
    Jun 2, 2008
  5. M. Norton
    Replies:
    10
    Views:
    933
    Marcus Harnisch
    Sep 25, 2008
Loading...

Share This Page