Re: How to pass Application.Item value back to class?

From: lezmark (lezmark_at_cox.net)
Date: 11/11/04


Date: Thu, 11 Nov 2004 08:55:37 -0600

Hi,
 Just a thought, Can't you pass the application settings as a parameter to
the caller?
As the context is entirely different( I mean the web context and your
processing classes), or in other words ,configuration is different from
processing classes, will you be able to change your code to accept
application settings as parameters from the asp.net page?

--
Arul
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message 
news:beo6p09jghl4dn0i951s3avbq5gcjrd7jh@4ax.com...
> Hi Adolf:
>
> As long as the class is working during a web request, it can use
> System.Web.HttpContext.Current to tap into the context of the web
> request. For example:
>
> HttpContext.Current.Application["foo"] = o;
>
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
>
> On Thu, 11 Nov 2004 04:29:06 -0800, adolf garlic
> <adolfgarlic@discussions.microsoft.com> wrote:
>
>>Suggestions please for strategy to share values across app.
>>
>>Scenario:
>>
>>I have an asp.net app that uses some com components along with .net 
>>classes.
>>
>>Configuration settings for various things are held in an xml file to which
>>the com has access. The xml file has different nodes for different 
>>instances
>>(dev,uat1,uat2 etc..) there is a flag attribute to show current instance.
>>
>>The asp.net app loads the xml in global.asax and extracts a bunch of data
>>into Application.item variables.
>>
>>What I can't then do is access the Application variables from any classes 
>>in
>>the app that are not associated with a web page.
>>
>>Yes I can put the values into web.config but this present 2 problems
>> - you need to write a messy section handler with namevalue object to read
>>any data
>> - the com can't see the file (well it can but for admin purposes you
>>shouldn't need to duplicate values - more scope for going wrong)
>>
>>Can anyone think of a way in which I can pass Application variables back 
>>to
>>a class?
>>
>>Thanks
> 


Relevant Pages

  • Re: Existing Web app gets error after WSS install (solved)
    ... If the .NET app uses session state, ... I don't know if the above is a comprehensive list of settings ... > I then went into the Central Admin and used Define Managed Paths to ... > context) +170 ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Ini File vs Registry
    ... How do you manage the settings? ... dollars in hacking the OS to introduce the concept of registry ... Hard to migrate app ... but increasingly desktop developers are fighting it out ...
    (microsoft.public.vc.mfc)
  • Re: Deployment + Vista
    ... The problem is it's connection string is always ... Server settings form. ... possibly occur with a file created by your app. ... I guess it's a good thing I do not use that for settings. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Disable start and stop recording sounds?
    ... when launching an app be locked down? ... still a way to go in many areas for Linux but many prefer it. ... everyone elses to take advantage of "hive support" from their co-workers ... Some settings are nested three, ...
    (microsoft.public.pocketpc)
  • Save + Restore form variables
    ... are normally presented to the user sequentially to set operational parameters ... We're trying to turn this highly-interactive app into a CGI app that can run in ... Some local variables are set up as public and published properties, ... settings in the form, ...
    (borland.public.delphi.thirdpartytools.general)