title: Umbraco 7 mvc how to get current page id
body: <p>I have a custom controller to send message. So I need to get the value of property field name and alias = "email", this will be used to send the email to.</p>
  
  <p>this code below works</p>
  
  <pre><code> var id = umbraco.uQuery.GetNodeByUrl("/contact-us");
   IPublishedContent root = Umbraco.TypedContent(id.Id);
   return root.GetProperty("email", true).Value.ToString();
  </code></pre>
  
  <p>However the problem here is if the page name changes, the url will change and the code will break.</p>
  
  <p>So how can I change the code above to get the current page id and insert it here (???);?</p>
  
  <p>I think the code should be something like this: </p>
  
  <pre><code> IPublishedContent root = Umbraco.TypedContent(???);
   return root.GetProperty("email", true).Value.ToString();
  </code></pre>
  
  <p>Any help will be apprecciated</p>