如何从 app_code 中的类在母版页中设置属性?用asp.net c#
我的主页:
private int styleGroup;
public int StyleGroup
{
get { return styleGroup; }
set { styleGroup = value; }
}
如何从 app_code 中的类设置 StyleGroup?像这样的东西,但它不起作用:
Page currentPage = (Page)HttpContext.Current.Handler;
currentPage.Master.StyleID = 5;
谢谢