CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 8/6/2005 4:24:01 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 8 Views: 26 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
9 Items, 1 Pages 1 |< << Go >> >|
WhatThe12
Asp.Net User
Accessing Session from within a web control8/6/2005 4:24:01 PM

0/0

Hi,

Is it considered bad design to have a web control depend on Session state? I mean have properties which get their value from Session instead of, say, Viewstate.

Cheers,

WT.
Web dev - spending forever achieving nothing.
joteke
Asp.Net User
Re: Accessing Session from within a web control8/6/2005 5:03:08 PM

0/0

Hi,

if thinking generally, yes it is bit bad, because it assumes that session is always in use in the web app where the control is used in. What if it isn't available for some scenarios? Another thing is that it adds quite burden to the server, because session state doesn't get GC's & collected after you leave the page (like Viewstate does), but it's there for the entire session (basically user is also tied to one instance of the same control on one page, especially dangerous if controls themselves set something to the session as well because they could override each other's values as they share the same session variable).

So if you need something to the control from the session, let the control take it via a property and the setter (e.g the Page) takes care of where that value comes from, e.g deals with the session, that's my recommendation.

However, I wouldn't say that you couldn't use it if it solves a specific problem and won't cause problems e.g you've been thinking carefully that it's the only way. But you've been warned. :-)
Thanks,

Teemu Keiski
Finland, EU
WhatThe12
Asp.Net User
Re: Accessing Session from within a web control8/6/2005 7:44:05 PM

0/0

That makes sense. Thanks.


Web dev - spending forever achieving nothing.
WhatThe12
Asp.Net User
Re: Accessing Session from within a web control8/6/2005 8:55:10 PM

0/0

"basically user is also tied to one instance of the same control on one page, especially dangerous if controls themselves set something to the session as well because they could override each other's values as they share the same session variable"

You could make the session key depend on the unique ID or a GUID.
Web dev - spending forever achieving nothing.
joteke
Asp.Net User
Re: Accessing Session from within a web control8/7/2005 6:48:49 AM

0/0

 WhatThe12 wrote:
"basically user is also tied to one instance of the same control on one page, especially dangerous if controls themselves set something to the session as well because they could override each other's values as they share the same session variable"

You could make the session key depend on the unique ID or a GUID.


Sure but that would make it even worse, from resource use viewpoint, if you reuse (and probably you will) the same control in the app within the same session. You multiply the use of the session variables. E.g multitude of ViewState parameters but scope being session. :-)
Thanks,

Teemu Keiski
Finland, EU
defaulk
Asp.Net User
Re: Accessing Session from within a web control8/19/2005 4:02:37 PM

0/0

I hope you don't mind if I resurrect this discussion.  I do find it necessary in my case to create a control that stores information in the session. 

(If you don't care about the reason, just skip this paragraph.)  My control creates a table plus other information based upon a sql statement.  At the bottom of this table, there is supposed to be a link offering a csv download of the information in the table.  Since the SQL is ad hoc from the control's perspective, it needs to store that SQL in a way that the csv generating asp page can be aware of the SQL, run the query and generate.  The logical choice would be for the control to hold that sql in the session using a key that is built from a guid.  Then in the csv generating page, I can reference the session information using that key in order to retrieve the SQL.

So anyway, it's important for me to be able to access the session from the control itself.  How do I do this?
joteke
Asp.Net User
Re: Accessing Session from within a web control8/19/2005 4:14:29 PM

0/0

 defaulk wrote:
I hope you don't mind if I resurrect this discussion.  I do find it necessary in my case to create a control that stores information in the session. 

(If you don't care about the reason, just skip this paragraph.)  My control creates a table plus other information based upon a sql statement.  At the bottom of this table, there is supposed to be a link offering a csv download of the information in the table.  Since the SQL is ad hoc from the control's perspective, it needs to store that SQL in a way that the csv generating asp page can be aware of the SQL, run the query and generate.  The logical choice would be for the control to hold that sql in the session using a key that is built from a guid.  Then in the csv generating page, I can reference the session information using that key in order to retrieve the SQL.

So anyway, it's important for me to be able to access the session from the control itself.  How do I do this?


Controls have always Context property which repressents the current HttpContext (all relevant data related to the request going on). Therefore accessing Session could be

[C#]
Context.Session["key"] = "value";

[VB]
Context.Session("key") = "value"
Thanks,

Teemu Keiski
Finland, EU
WhatThe12
Asp.Net User
Re: Accessing Session from within a web control9/18/2005 4:43:48 PM

0/0

Can't the page containing the control be responsible for storing the required information in session?
Web dev - spending forever achieving nothing.
joteke
Asp.Net User
Re: Accessing Session from within a web control9/19/2005 5:21:48 AM

0/0

 WhatThe12 wrote:
Can't the page containing the control be responsible for storing the required information in session?


LIke I said in some previous reply

So if you need something to the control from the session, let the control take it via a property and the setter (e.g the Page) takes care of where that value comes from, e.g deals with the session, that's my recommendation.

That would be ideal solution, if session is needed (my opinion)
Thanks,

Teemu Keiski
Finland, EU
9 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Citrix Access Suite 4 Advanced Concepts: The Official Guide Authors: Steve Kaplan, Anthony Jones, Andy Jones, Pages: 603, Published: 2006
Newton's Telecom Dictionary: Covering Telecommunications, Networking, Information Technologies, Wired, Wireless, Satellites, Fiber and the Internet Authors: Harry Newton, Pages: 1035, Published: 2006
Citrix MetaFrame Access Suite for Windows Server 2003: The Official Guide Authors: Tim Reeser, Steve Kaplan, Alan Wood, Pages: 608, Published: 2003
Creating Database-backed Library Web Pages: Using Open Source Tools Authors: Stephen R. Westman, Pages: 268, Published: 2006
Developing Microsoft ASP.NET Server Controls and Components Authors: Nikhil Kothari, Vandana Datye, Pages: 689, Published: 2002
Cooperative Environments for Distributed Systems Engineering: The Distributed Systems Environment Report Authors: Khalil Drira, Andrea Martelli, Thierry Villemur, Pages: 279, Published: 2001
Advances in Web Intelligence: Third International Atlantic Web Intelligence Conference, AWIC 2005, Lodz, Poland, June 6-9, 2005 : Proceedings Authors: Piotr S. Szczepaniak, Janusz Kacprzyk, Adam Niewiadomski, Pages: 513, Published: 2005
Microsoft Visual C# 2005 Unleashed Authors: Kevin Hoffman, Pages: 692, Published: 2006
Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers Authors: Brennan Stehling, Pages: 408, Published: 2007
The Internet Encyclopedia Authors: Hossein Bidgoli, Pages: 0, Published: 2004

Web:
'"Compaq Web Agent" management session can be re-used without the ... Allow anonymous access to the agent session 3. Allow local access (as anonymous ... Always use the "logout" link from within the web session - This way any ...
Retrieving SESSION values from within User Control (ascx) - ASP ... How can I gain access to the SESSION variables from within the User ... System. Web.HttpContext.Current.Session("myvalue"). Works fine! ...
Web User Control and using session, request and response Talk about Web User Control and using session, request and response. ... I tried to access the page from a user control, doing it this way: ...
SecurityTracker.com Archives - Cisco Secure Access Control Server ... Cisco Secure Access Control Server Session Authentication Weakness Lets Remote ... ACLs within Cisco Secure ACS to restrict access to the web interface from ...
Access Session State From Class File in App_Code - .NET ASP app_code? this.Session["MySessionData"] doesn't work from within the class file! ... thanks to the System.Web.UI.Page or Controls. You have to reference the ...
PHP Bugs: #7717: No access to server & session variables from ... Bug #7717, No access to server & session variables from within a class ... PHP. net Systems Operation problem, Output Control, Performance problem ...
WebEx Audio datasheet: Get more from your web meetings with ... Get more from your web meetings. with integrated audio. Make it easier to schedule and join meetings—and control audio. from within the session. ...
How can I initiate remote control of a session from the command ... (Remember that you can only remotely control a session from within another ... Get it all with the VIP CD and VIP access. A $500+ value for only $279! ...
How can I initiate remote control of a session from the command ... (Remember that you can only remotely control a session from within another Terminal ... which helps limit the file resources that an application can access . ...
Propalms - The Ultimate Management Tool for Microsoft Windows ... Control access to TSE published applications by domain group, ... All of this can be done from within the web based management console meaning the ...

Videos:
Core Patterns for Web Permissions Google TechTalks July 19, 2006 Tyler Close Visiting Scientist Hewlett-Packard Laboratories Mr. Close is a researcher and developer ...
Web Applications and the Ubiquitous Web Google TechTalks February 1, 2006 Dave Raggett Dave Raggett is currently a W3C Fellow from Canon, and W3C Activity Lead for Multimodal ...
TALKING TO THE TALIBAN [Part 5/7] - PAKISTAN KANDAHAR, AFGHANISTAN, March 26, 2008, Despite a long history of using Pakistan as a safe haven, Taliban on the front lines of the insurgency say ...
The Italian unauthorized monopoly of VAS service 48XXX http://www.smsvas.com On the 28th of June at the Politecnico of Milan, during the congress organized for the presentation of the 2007 Research ...
Dr. Mike Woo-Ming Affiliate Heroes "With Great Power Comes Great Profitability..." It's Finally Here! 6 Weeks of Interviews with the Top SuperAffiliates ...
الله اكبر PLEASE READ VERY CAREFULLY THESE TERMS AND CONDITIONS AND THE PROGRAM FREQUENTLY ASKED QUESTIONS LOCATED ON THE PROGRAM WEBSITE AT https ...
5 Keys to Successful Internet Marketing - 6 Figure Income Secrets http://www.SucceedWithGlobal.com Austin, Texas September 14, 2008 The most common question I am asked when I talking to people about my Global ...
Beatles The Beatles Paul McCartney, Ringo Starr, George Harrison, and John Lennon Beatles Soundtrack (partials) 0:00 - 0:13 Twist & Shout 0:14 ...
Fogos 2008 ! PLEASE READ VERY CAREFULLY THESE TERMS AND CONDITIONS AND THE PROGRAM FREQUENTLY ASKED QUESTIONS LOCATED ON THE PROGRAM WEBSITE AT https ...
الجهاد PLEASE READ VERY CAREFULLY THESE TERMS AND CONDITIONS AND THE PROGRAM FREQUENTLY ASKED QUESTIONS LOCATED ON THE PROGRAM WEBSITE AT https ...




Search This Site:










handling static html page from asp.net

help vwd setup failiure!

windowsprincipal.isinrole() returns a trust relationship error

dnn connection woes

beta2 wizard validator problem

about treeview,how to auto check all child treenodes?

sqlheper

secure cookie

need host with decent bandwidth and quick response time...

support desk 2.5 won't install on dnn 2.1.2

authentication via sessions and multiple pages in asp.net?

how to authenticate an .exe file

css layout and solpart menu problems

stuck without multiple inheritance

how to track whether a page is idle?

problem about website administration tool

custom control array property (is read only!?!)

inactive links in content page when master page has links

discussion module error--page cannot be found

using menu as site navigation

using google maps api with master pages

why aren't usernames unique to portals?

shrink sql server express database

why are there brackets around the attribute variables?

admin of ibuyspy

admin module

cache.count = 0 after adding item

help me critical error, what does this mean?

newbie: easy module navigation question

newbie question - how to create multiple parent portals with multiple domains - dnn3.1

 
All Times Are GMT