我正在尝试初始化DataPager SetPageProperties()方法,但由于未知的原因,我得到了以下结果
错误“任命”不包含“DataPager1”的定义,也找不到接受“任命”类型的第一个参数的扩展方法'DataPager1‘(您缺少使用指令还是程序集引用?)
这是代码
protected void ListView1_PagePropertiesChanged(object sender, EventArgs e)
{
indexDdl = Convert.ToInt32(Session["dentistId"]);
int StartRowIndex = 0;
int MaximumRows = 10;
this.DataPager1.SetPageProperties(StartRowIndex, MaximumRows, true); <= error with DataPager1
Appointement(indexDdl);
}这是.aspx页面
<asp:DataPager ID="DataPager1" runat="server" Autopostback="true" >
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True"
ShowLastPageButton="True" />
</Fields>
</asp:DataPager>知道为什么不能用吗?
发布于 2015-01-31 11:37:09
DataPager DataPager1;
DataPager DataPager1 = ListView1.FindControl("DataPager1") as DataPager;https://stackoverflow.com/questions/21446349
复制相似问题