How to get the property value of the page which is requested by user in episerver cms 10...
public string GetContent(string pageType, string propertyName)
{
Type type = Type.GetType(pageType); //target type
object o = Activator.CreateInstance(type);
var pageLink = new ContentReference();
var contentLoader= ServiceLocator.Current.GetInstance<IContentLoader>();
var content = contentLoader.Get<type>(pageLink);
var vals = content.GetPropertyValue(propertyName);
return vals;
}
In the above method i have get the page name and property name from the url .... so in this i have convert the variable pageType ( i.e. page name ) to class and use it in Get<> method..but it is not working...some body please tell me the solution... or else is there any other way to find property vakue of the user requested property in requeted page.....