我的 asp 页面上有一个转发器,我想将该转发器与后面的代码绑定(C#)。在 c# 页面上,我有一个静态方法来绑定转发器。但我收到错误
“对象未设置为对象的实例”
我拥有的静态方法是..
[WebMethod(EnableSession = true)]
public static void LoadData()
{
Default oDefault = new Default();
Page p = new Page();
if ((List<AllPostInformation>)p.Session["AllNewsPostCollection"] != (List<AllPostInformation>)p.Session["CheckExistData"])
{
if ((List<AllPostInformation>)p.Session["AllNewsPostCollection"] != null)
{
List<AllPostInformation> o = new List<AllPostInformation>();
o = (List<AllPostInformation>)p.Session["AllNewsPostCollection"];
oDefault.rptNews.DataSource = o;
oDefault.rptNews.DataBind();
}
p.Session["CheckExistData"] = p.Session["AllNewsPostCollection"];
}
}
Please Help???