int next;
int top;
int p=20;
int currePage=Convert.ToInt32(Request.QueryString["page"]);
int count=this.CountTopic(id);
int pageNum=count/p;if (currePage==1)
{
next=currePage+1;
top=currePage;
}
else 
{
if(currePage<pageNum)
{
next=currePage+1;
top=currePage-1;
}
if(currePage==pageNum)
{
next=pageNum;
top=currePage-1;
}
}
this.nextPage.NavigateUrl="?id="+id+"&Page="+next+"";
this.topPage.NavigateUrl="?id="+id+"&Page="+top+"";
为什么编译的时候:
F:\www\80years\right.aspx.cs(104): 使用了未赋值的局部变量“next”
F:\www\80years\right.aspx.cs(104): 使用了未赋值的局部变量“top”