I have a normal web form with code behind, in this code behind I can instantiate a couple of classes I have in the root folder, such as:
public partial class _Default : System.Web.UI.Page
{
Helper helper = new Helper();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Initialise();
}
}
And in the Helper class:
public class Helper
{
It’s working fine but I now want to move my class files (Helper.cs for example) to the app_code folder but when I run the application I get error on
SharePoint sharePoint = new SharePoint();
public string id { get; set; }
must declare a body because it is not marked abstract or extern
What is causing this issue and how do I fix it?
Thanks in advance
is an automatic property and these were added in C# v3.0 / .Net v3.5, so ensure you are targetting this version or higher in your project settings. If you wish to target an earlier version you’ll need to use properties with a backing field.