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”
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”
解决方案 »
- 急求思路...随机取数据 在线急等...
- 如何基于asp.net实现ListBox控件的鼠标拖拽功能
- 关于用ASP.net的两个新手级别的问题,希望各位大虾帮忙解答
- 如何让asp.net2.0里的datagrid自带分页执行脚本??
- 调试问题
- 关于设置DataGrid输出到EXCEL时单元格格式的设置问题
- gridview 里模板列里textbox 当textchanged触发gridview什么事件?
- 请问如何修改ASP.net的运行超时时间呢?
- 这条语句如何改
- 200分跪拜求助,邪门的简单问题-静态页面的发布
- 我男朋友好久没来找我了,我好想,真的好想~~~来嘛~~~~
- 首页的repeater绑定显示问题,有原码。
int top = 0;