大家好我在我的asp.net網頁中有一箇中繼器控件。我想從中繼器控制中選擇月份,並從當月的基準中獲取我在該月發佈的所有數據以下是中繼器控制的源代碼。從中繼器控制中獲取數據在所選記錄的基礎上
<asp:Repeater ID="Repeater1" runat="server"
onitemcommand="Repeater1_ItemCommand">
<ItemTemplate>
<ul class="archive">
<li><a href="#">
<%#Eval("mnth") %>
<%#Eval("yr") %><span>(<%#Eval("totalcount") %>)</span>
<%--<asp:Label ID="Label6" runat="server" Text="<%#Eval("mnth") %>">
<asp:Label ID="Label8" runat="server" Text="<%#Eval("yr") %>"></asp:Label><span> (
<asp:Label ID="Label7" runat="server" Text="<%#Eval("totalcount") %>"></asp:Label>) </span> </a></li>--%>
</ul>
</ItemTemplate>
</asp:Repeater>
這裏是我用來將Repeater控件綁定
private void BindPostCounts()
{
SqlCommand cmdBindCounts = new SqlCommand("CountBlogPost_sp", con);
cmdBindCounts.CommandType = CommandType.StoredProcedure;
SqlDataAdapter daBindCounts = new SqlDataAdapter(cmdBindCounts);
DataSet dsBindCount = new DataSet();
daBindCounts.Fill(dsBindCount);
Repeater1.DataSource = dsBindCount;
Repeater1.DataBind();
}
的代碼,這是我使用
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[BlogPost](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Title] [varchar](500) NULL,
[Blogpost] [nvarchar](max) NULL,
[Paramlink] [varchar](500) NULL,
[PostDate] [datetime] NULL,
[IsActive] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
上現在每月基地選擇我要表得到我在那個月發佈的數據請告訴我哪個事件我必須工作
就請您從中獲取數據表指定信息 –
@Rony請編輯我的問題加我的表 –
@AzadChohan - 使用ID與隱藏字段.... –