I just did resolve this issue by deriving my own class from
SessionParameterInfo
.
See this example as a start:
namespace MyNameSpace
{
using System.Reflection;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public class LoggedInUserSessionParameter :
SessionParameter
{
protected override object Evaluate(
HttpContext context,
Control control)
{
if ((context != null) && (context.Session != null))
{
var fieldName = SessionField;
var liui = context.Session[@"CurrentUserInfo"] as LoggedInUserInformation;
if (liui == null)
{
return null;
}
else
{
return liui.GetType().InvokeMember(fieldName, BindingFlags.GetProperty, null, liui, null);
}
}
else
{
return base.Evaluate(context, control);
}
}
}
}
You than can register the control on your page:
<%@ Register Namespace="MyNameSpace" TagPrefix="mns" %>
And then use it like this:
<mns:LoggedInUserSessionParameter Name="LegalEntityID" SessionField="LegalEntityID" Type="Int32" />
Regards
Uwe