I have a “Page” that implement my own “Permission” interface.
public interface PagePermissions{
Dictionary<string, Permission> readPermissions();
}
public partial class myWebPage: System.Web.UI.Page, PagePermissions
{
protected void Page_Load(object sender, EventArgs e)
{
}
Dictionary<string, Permission> PagePermissions.readPermissions()
{
Dictionary<string, Permission> results = new Dictionary<string, Permission>();
return results;
}
}
In my master page, I get a reference to the current Page object.
Page myPage = HttpContext.Current.Handler as Page;
But I can’t call my function ReadPermission because it’s not recognizing it:
myPage.readPermissions();
How do I call my implemented function?
You need to cast
myPagetoPagePermissions.