In my umbraco website I am trying to access a function through razor script. Function is written in C#, compiled and added dll to my umbraco website.
public static XPathNodeIterator GetProductsFromId(string Id)
{
XPathNodeIterator items;
string asd= string.Concat("product", Id);
if (HttpContext.Current.Items[asd] == null)
{
XmlDocument xmlDocument = new XmlDocument();
HttpContext.Current.Items.Add(asd, xmlDocument.CreateNavigator().Select("."));
}
items = (XPathNodeIterator)HttpContext.Current.Items[asd];
return items;
}
and in my razor I am trying to acces this function like this
@inherits common.Web.blogic
@{
System.Xml.XPath.XPathNodeIterator v = GetProductsFromId("123456");
}
I believe I had done everything right but it creates an error likes this
Error loading Razor Script TestRazor.cshtml c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\2928d574\d747540e\App_Web_testrazor.cshtml.70df5e80.zwangvtf.0.cs(43): error CS0115: 'ASP._Page_macroScripts_TestRazor_cshtml.Execute()': no suitable method found to override