Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > WebCustomControl and session

Reply
Thread Tools

WebCustomControl and session

 
 
Mariusz
Guest
Posts: n/a
 
      09-24-2004
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


 
Reply With Quote
 
 
 
 
Robert Koritnik
Guest
Posts: n/a
 
      09-27-2004
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
>
>



 
Reply With Quote
 
 
 
 
Robert Koritnik
Guest
Posts: n/a
 
      09-27-2004
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
>
>



 
Reply With Quote
 
Robert Koritnik
Guest
Posts: n/a
 
      09-27-2004
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
> >
> >

>
>



 
Reply With Quote
 
Mariusz
Guest
Posts: n/a
 
      09-27-2004
> 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


 
Reply With Quote
 
Robert Koritnik
Guest
Posts: n/a
 
      09-28-2004
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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WebCustomControl and AppSettings - Help! bharathmr ASP .Net 0 03-24-2008 01:08 PM
postback and webcustomcontrol Alexander Widera ASP .Net 1 03-21-2006 09:02 AM
Add Click Event to my WebCustomControl? Lars Netzel ASP .Net 3 01-03-2005 08:47 PM
Setting a Default Width and Height in WebCustomControl? Lars Netzel ASP .Net 1 12-31-2004 09:11 PM
WebCustomControl & DTD Lloyd Dupont ASP .Net 0 08-08-2003 02:12 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57