【发布时间】:2009-04-05 13:10:06
【问题描述】:
我在页面上的 ListView 控件中有一个标准页面,并且寻呼机正在工作,但是为了移动到下一个项目列表,我需要在它实际移动到下一组项目之前单击两次寻呼机链接。
寻呼机的代码是:
<asp:ListView ID="lv_LostCard" runat="server" DataKeyNames="request_id" EnableViewState="false">
<LayoutTemplate>
<table width="550" border="1" class="table">
<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
</table>
<asp:DataPager ID="lv_Books_Pager" runat="server" PageSize="10">
<Fields>
<asp:NextPreviousPagerField ShowFirstPageButton="false" ShowPreviousPageButton="true" ShowNextPageButton="false" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ShowFirstPageButton="false" ShowPreviousPageButton="false" ShowNextPageButton="true" ShowLastPageButton="false" />
</Fields>
</asp:DataPager>
</LayoutTemplate>
<ItemTemplate>
</ItemTemplate>
</asp:ListView>
后面的代码是:
protected void Page_Load(object sender, EventArgs e) { 如果(!Page.IsPostBack) { getLostCardsList(); } }
protected void getLostCardsList()
{
using(LostCardsManagementDataContext LostCard = new LostCardsManagementDataContext())
{
var getLostCardsList = from lc in LostCard.lostcard_request_cards
select lc;
lv_LostCard.DataSource = getLostCardsList;
lv_LostCard.DataBind();
}
谁能告诉我发生了什么以及如何解决它?
提前致谢
【问题讨论】: