在我的 SharePoint 2010 c# / asp.net 站点中,我定义了一个类
namespace PDF_Library.VisualWebPart1
{
public partial class PDF_Library : Usercontrol
{
public static PDF_Library current;
protected void Page_Load(object sender, EventArgs e)
{
current = (PDF_Library)this;
}
}
}
public static class Page_State
{
public static Page is_display()
{
return PDF_Library.current.Page; // didn't work...
}
}
它没有构造函数。我怎样才能得到参考the current instance of this class
?
我在顶部尝试过这样的事情
public static PDF_Library current;
然后在一个函数中
current = (PDF_Library)this;
但这没有用...