Il codice che hai proposto funziona correttamente (framework 4)
In App_code, nel file Class1.cs, dopo aver cancellato tutto, ho messo
codice:
public enum Direction
{
Horizontal,
Vertical
}
nella pagina Default.aspx
codice:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.DisplayDirection = Direction.Horizontal;
}
public Direction DisplayDirection { get; set; }
}