private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(page!=null)
{
try
{
currentPage = Int16.Parse(page);
//
}
catch
{
Response.Redirect(Request.Path);
return;
}
}
if(!Page.IsPostBack)
{
fillList();
for(int i=1;i<=pd.PageCount;i++)
{
DropDownList1.Items.Add(new ListItem(i.ToString(),i.ToString()));

}
}
}DropDownList1.Items.FindByText(currentPage.ToString()).Selected=true;
 //这段不管是放在Page_Load中还是fillList中总出错:
System.NullReferenceException: 未将对象引用设置到对象的实例。
这里的currentPage是绝对有值的,为什么会出错呢?