WebCustomControl and session

Discussion in 'ASP .Net Web Controls' started by Mariusz, Sep 24, 2004.

  1. Mariusz

    Mariusz Guest

    Hi,

    I would like to know if this is possible to gain access to session in
    WebCustomControl. Cause I need to pass some data and persist it. I know that
    it is possible to have acces to QueryString but this is not enought.

    BTW: How do You handle such sitiuation where control have a lot of
    additional properties that must be persisted. How do You persist them? In
    session? Request? Forms?

    Another question - is is possible to include some aspx'es in
    WebCustomControl dll? Cause my control makes a call to the .aspx using
    IFrame, and this aspx is internal part of the control. Without this control
    wont work. I know that this is not good idea to make aspx an integral part
    of the control but I wanted to be able to reload contents of the control
    without reloading the whole page.


    --
    Cheers
    Mariusz
     
    Mariusz, Sep 24, 2004
    #1
    1. Advertising

  2. Of course it's possible. Check for HttpContext.Current. If it's not null,
    you have access to Session, Cache, Application, Request, Response... etc.

    --
    RobertK
    { Clever? No just smart. }


    "Mariusz" <> wrote in message
    news:4154121c$...
    > Hi,
    >
    > I would like to know if this is possible to gain access to session in
    > WebCustomControl. Cause I need to pass some data and persist it. I know

    that
    > it is possible to have acces to QueryString but this is not enought.
    >
    > BTW: How do You handle such sitiuation where control have a lot of
    > additional properties that must be persisted. How do You persist them? In
    > session? Request? Forms?
    >
    > Another question - is is possible to include some aspx'es in
    > WebCustomControl dll? Cause my control makes a call to the .aspx using
    > IFrame, and this aspx is internal part of the control. Without this

    control
    > wont work. I know that this is not good idea to make aspx an integral part
    > of the control but I wanted to be able to reload contents of the control
    > without reloading the whole page.
    >
    >
    > --
    > Cheers
    > Mariusz
    >
    >
     
    Robert Koritnik, Sep 27, 2004
    #2
    1. Advertising

  3. About persisting properties. Hmmm. Depends on properties. The most common
    way is to store properties to ViewState if you have to. But if functionality
    demands more, you can use alternative storages like Session, Application,
    Cache...

    Normally some property as collections of some objects that are filled from
    XMLs, are normally put into Cache with file dependancy. Especialy if data is
    shared between users (like some sort of application menu item collection)...

    So the answer is: There is no ultimate store... Each has its pros/cons...
    Use the one that's most appropriate for the desired functionality...

    About the custom control containing ASPX? I don't really get it what you
    want to do. Qour custom control, an IFRAME an ASPX... Where what how? Try to
    explain this in more detail. At least to me. Looks like I'm stupid.
    --
    RobertK
    { Clever? No just smart. }

    "Mariusz" <> wrote in message
    news:4154121c$...
    > Hi,
    >
    > I would like to know if this is possible to gain access to session in
    > WebCustomControl. Cause I need to pass some data and persist it. I know

    that
    > it is possible to have acces to QueryString but this is not enought.
    >
    > BTW: How do You handle such sitiuation where control have a lot of
    > additional properties that must be persisted. How do You persist them? In
    > session? Request? Forms?
    >
    > Another question - is is possible to include some aspx'es in
    > WebCustomControl dll? Cause my control makes a call to the .aspx using
    > IFrame, and this aspx is internal part of the control. Without this

    control
    > wont work. I know that this is not good idea to make aspx an integral part
    > of the control but I wanted to be able to reload contents of the control
    > without reloading the whole page.
    >
    >
    > --
    > Cheers
    > Mariusz
    >
    >
     
    Robert Koritnik, Sep 27, 2004
    #3
  4. Or over this.Pageā€¦ Every web custom control inherited from Control inherits
    Page property from it.

    --
    RobertK
    { Clever? No just smart. }

    "Robert Koritnik" <> wrote in message
    news:...
    > Of course it's possible. Check for HttpContext.Current. If it's not null,
    > you have access to Session, Cache, Application, Request, Response... etc.
    >
    > --
    > RobertK
    > { Clever? No just smart. }
    >
    >
    > "Mariusz" <> wrote in message
    > news:4154121c$...
    > > Hi,
    > >
    > > I would like to know if this is possible to gain access to session in
    > > WebCustomControl. Cause I need to pass some data and persist it. I know

    > that
    > > it is possible to have acces to QueryString but this is not enought.
    > >
    > > BTW: How do You handle such sitiuation where control have a lot of
    > > additional properties that must be persisted. How do You persist them?

    In
    > > session? Request? Forms?
    > >
    > > Another question - is is possible to include some aspx'es in
    > > WebCustomControl dll? Cause my control makes a call to the .aspx using
    > > IFrame, and this aspx is internal part of the control. Without this

    > control
    > > wont work. I know that this is not good idea to make aspx an integral

    part
    > > of the control but I wanted to be able to reload contents of the control
    > > without reloading the whole page.
    > >
    > >
    > > --
    > > Cheers
    > > Mariusz
    > >
    > >

    >
    >
     
    Robert Koritnik, Sep 27, 2004
    #4
  5. Mariusz

    Mariusz Guest

    > About persisting properties. Hmmm. Depends on properties. The most common
    > way is to store properties to ViewState if you have to. But if

    functionality
    > demands more, you can use alternative storages like Session, Application,
    > Cache...


    Yes I know. Right now I'm using Session to store all my data. And I think
    that I will keep this but just wanted to know what are You using.
    And btw: I'f found that I have acces to Page in Control. My foult :)

    > About the custom control containing ASPX? I don't really get it what you
    > want to do. Qour custom control, an IFRAME an ASPX... Where what how? Try

    to
    > explain this in more detail. At least to me. Looks like I'm stupid.


    It's little hard to explain. I'm using combination of user/custom control,
    aspx page and IFrame to create component that can be
    reloaded/moved/minimized and even closed without reloading the rest of the
    page. This is very usefull but I have to use aspx'a as a target for IFrame
    cause ascx cannot be target in IFrame. And it must be in IFrame so I can do
    all the operations I mentined before. I hope it's more clearly explained
    right now :)

    --
    Cheers
    Mariusz
     
    Mariusz, Sep 27, 2004
    #5
  6. Create the barebone ASPX and include it as a resource in your project. But
    what to do with it then? Hmmm. One possibility is to write it to disk and
    redirect to it, but you have to make shure that the class it refers to
    really does exist in your assembly.

    Maybe someone else has done something like forcing the asp.net CLR to
    process the aspx. Probably it's possible but if I were you, I'd check the
    namespaces that would fit the idea...

    --
    RobertK
    { Clever? No just smart. }

    "Mariusz" <> wrote in message
    news:4158076f$...
    > > About persisting properties. Hmmm. Depends on properties. The most

    common
    > > way is to store properties to ViewState if you have to. But if

    > functionality
    > > demands more, you can use alternative storages like Session,

    Application,
    > > Cache...

    >
    > Yes I know. Right now I'm using Session to store all my data. And I think
    > that I will keep this but just wanted to know what are You using.
    > And btw: I'f found that I have acces to Page in Control. My foult :)
    >
    > > About the custom control containing ASPX? I don't really get it what you
    > > want to do. Qour custom control, an IFRAME an ASPX... Where what how?

    Try
    > to
    > > explain this in more detail. At least to me. Looks like I'm stupid.

    >
    > It's little hard to explain. I'm using combination of user/custom control,
    > aspx page and IFrame to create component that can be
    > reloaded/moved/minimized and even closed without reloading the rest of the
    > page. This is very usefull but I have to use aspx'a as a target for IFrame
    > cause ascx cannot be target in IFrame. And it must be in IFrame so I can

    do
    > all the operations I mentined before. I hope it's more clearly explained
    > right now :)
    >
    > --
    > Cheers
    > Mariusz
    >
    >
     
    Robert Koritnik, Sep 28, 2004
    #6
    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. Lloyd Dupont

    WebCustomControl & DTD

    Lloyd Dupont, Aug 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    307
    Lloyd Dupont
    Aug 8, 2003
  2. Lars Netzel
    Replies:
    1
    Views:
    317
    Lars Netzel
    Dec 31, 2004
  3. Lars Netzel

    Add Click Event to my WebCustomControl?

    Lars Netzel, Jan 3, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,630
    =?Utf-8?B?RHVzYW4gWnVwYW5jaWM=?=
    Jan 3, 2005
  4. Alexander Widera

    postback and webcustomcontrol

    Alexander Widera, Mar 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    396
    Alexander Widera
    Mar 21, 2006
  5. bharathmr
    Replies:
    0
    Views:
    276
    bharathmr
    Mar 24, 2008
Loading...

Share This Page