Hi,

the problem is that if you are using Ajax.NET in a Page you are using
the property of the Page. Because Ajax.NET does not fire all the
events during the common lifecycle the properties are not set correct.
I always recommend to put your Ajax.NET methods in separate classes,
maybe as static, too.

You have to use always:

System.Web.HttpContext.Current.Session
System.Web.HttpContext.Current.Cache
System.Web.HttpContext.Current.Application
System.Web.HttpContext.Current.Server
...

instead of the properties of the Page. Yes, it is a little bit
difficult if you do not know the background.

Regards,
Michael




On 4/5/06, Cory <[EMAIL PROTECTED]> wrote:
>
> Okay,
>
> I thing I have identified the issue.
>
> My Ajax method calls a method in a custom base class.  This method
> accesses both the Cache and an Application variables. The application
> variable was only accessed if the cached item had already been removed
> from the cache (after 5 minutes).
>
> I use the following syntax to access the cache:
>
>        Dim myContext As HttpContext
>        Dim x as Database = myContext.Current.Cache.Item("Db")
>
> For the application variables I was using the following:
>
>       Dim DbName as string = Application("MyDb").ToString
>
> I changed the syntax above to the following:
>
>      Dim DbName as string =
> myContext.Current.Application("MyDb").ToString
>
> My question is why do I need to access the cache and application
> variables in this manner?
>
> Thanks again to everyone who responded.
>
> - Cory
>
>
> >
>


--
Kind regards,
Michael Schwarz

Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer

http://www.schwarz-interactive.de/
mailto:[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to