I have made use of the /base methods in umbraco and got it all working. However if I want to make use of a Session element where I have refered to HttpContext.Current.Session["MyRequestedSession"], whenever I try to read a value it crashes. I have offcourse tested if there are any info in the session, which there however I suspect that the error lies in /base being url accessed and it therefor might not know anything about sessions.
So my question is simply put if anyone got a session element to work in there /base in a static content, and if they could then post an example of how it works.
INNEREXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object. at Designit.Umb.Newsletter.Custom.EmbedNewsletter.Embstep4(String templateAlias) in C:\Projects\Designit.Umb.Newsletter\Designit.Umb.Newsletter.Custom\EmbedNewsletter.cs:line 108 </error>
That approach might work, however I don't have access to the web.config file, but atm I have solved it temporarely with addind a temporarely database that stores my sessions value
Take a look at this I had the problem of not being able to access the session from /base when using umbraco 4.0.3. After a bit of searching I found a fix.
I have since started using 4.5.2 and its much better especially the new way of doing xslt.
session problem in static base class
Greetings
I have made use of the /base methods in umbraco and got it all working. However if I want to make use of a Session element where I have refered to HttpContext.Current.Session["MyRequestedSession"], whenever I try to read a value it crashes. I have offcourse tested if there are any info in the session, which there however I suspect that the error lies in /base being url accessed and it therefor might not know anything about sessions.
So my question is simply put if anyone got a session element to work in there /base in a static content, and if they could then post an example of how it works.
With kind regards
Christoffer
Oh yeah forgot basic info.
Using umbraco 4.0.3
IIS 7
and the error I was presented with upon trying to access my session is foloowing:
<error>
MESSAGE:
Exception has been thrown by the target of an invocation.
STACKTRACE:
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at umbraco.presentation.umbracobase.requestModule.invokeMethod(restExtension myExtension, Object[] paras)
INNEREXCEPTION:
System.NullReferenceException: Object reference not set to an instance of an object.
at Designit.Umb.Newsletter.Custom.EmbedNewsletter.Embstep4(String templateAlias) in C:\Projects\Designit.Umb.Newsletter\Designit.Umb.Newsletter.Custom\EmbedNewsletter.cs:line 108
</error>
Hi Christoffer,
Have you tried adding the following to your web.config?
Ron
That approach might work, however I don't have access to the web.config file, but atm I have solved it temporarely with addind a temporarely database that stores my sessions value
By the way. This conversation was some time ago, but the approach of runallmanagedmodules does not work.
Does anyone know what does?
Hi Martin,
Take a look at this I had the problem of not being able to access the session from /base when using umbraco 4.0.3. After a bit of searching I found a fix.
I have since started using 4.5.2 and its much better especially the new way of doing xslt.
Ben
is working on a reply...