Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I need to get a value from Umbraco in a module, but no matter what I try I cannot get it to work as cannot get the value, can anyone help please.
My code is below:
public class TestModule : IHttpModule
public void Dispose()
public void Init(HttpApplication app)
app.BeginRequest += (app_BeginRequest);
private void app_BeginRequest(object sender, EventArgs e)
UmbracoHelper helper = new UmbracoHelper(UmbracoContext.Current);
var helper2 = UmbracoContext.Current.ContentCache;
var test3 = helper.UmbracoContext.PageId;
IPublishedContent content = helper.TypedContent(test3);
var propertyValue = content.GetPropertyValue("valueRequired");
The value can be on any Umbraco page/doctype
look this: http://dejanstojanovic.net/umbraco-cms/2015/march/accessing-umbracohelper-in-httphandler-request/
Hi Marcio Goularte
Think I came across that post before, looked at so many so not sure. I get message 'UmbracoContext.EnsureContext' is obsolete.
Is it possible for another example
Even being obsolete I have used it without problems.
But see this link
It's not because something that is marked obsolete, that it is not working. A few methods have been deprecated because there will be (a better / easier) alternative in v8. However v8 is not launched yet. So for many calls you do not need to panic.
If the "obsoleted" method is not mentioning what you SHOULD use, then don't change it yet.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted