Is there any way to store variables in the request scope?
I know in Java you can add attributes (variables) to a request. These attributes only exist for the request and are destroyed once the request is returned.
I know I could use session variables to store stuff but due to my server configuration this isn't ideal.
(sorry this is a .net question - I posted here as I'm using this in Umbraco and if its possible I'll make an XSLT extension)
I'm quite new to .net so sorry if this is a stupid question!
You can store variables for the duration of the request in HttpContext. It's a key value pair dictionary.
This can be accessed from xslt via umbraco.library:ContextKey(string), however I'm not too sure if there's a built in way to write to it via xslt extension.
You could definately write your own extension to save values to the HttpContext.
I've done some googleing and the HttpContext is what I'm looking for.
@Nik - in Java I use request.setAttribute(key, object). I think the items in HttpContext are the .Net equivalent. Thanks for your help though!
My plan is to write an extension that allows XML (maybe NodesetIterator) to be stored onto the request so that data can be passed between various pages called using RenderTemplate.
If I get an extension written I'll post again with a package / link to a package.
Request Scope Variables
Hi,
Is there any way to store variables in the request scope?
I know in Java you can add attributes (variables) to a request. These attributes only exist for the request and are destroyed once the request is returned.
I know I could use session variables to store stuff but due to my server configuration this isn't ideal.
(sorry this is a .net question - I posted here as I'm using this in Umbraco and if its possible I'll make an XSLT extension)
I'm quite new to .net so sorry if this is a stupid question!
Thanks,
Ed
Hi Edward,
You can store variables for the duration of the request in HttpContext. It's a key value pair dictionary.
This can be accessed from xslt via umbraco.library:ContextKey(string), however I'm not too sure if there's a built in way to write to it via xslt extension.
You could definately write your own extension to save values to the HttpContext.
Cheers,
Chris
Hi Ed,
are you talking about CGI vars in Java? If so, check out this article http://forums.asp.net/t/1237153.aspx.
If not, can you give us a synopsis of what you are trying to do? We might be able to think of other ways other than session scope.
Thanks,
Nik
Thanks for the replies!
I've done some googleing and the HttpContext is what I'm looking for.
@Nik - in Java I use request.setAttribute(key, object). I think the items in HttpContext are the .Net equivalent. Thanks for your help though!
My plan is to write an extension that allows XML (maybe NodesetIterator) to be stored onto the request so that data can be passed between various pages called using RenderTemplate.
If I get an extension written I'll post again with a package / link to a package.
is working on a reply...