我想在重复标记中显示数据,这些数据来自sql数据库。我的问题是数据没有显示。谁能帮我这个 ? 流程是用户单击资源中的一个名称chkResourceName1.SelectedValue时,用户选择的名称将带有一个身份ID。然后,转发器项将显示chkResourceName1.SelectedValue携带的id的数据。但是问题是数据没有显示。
这是我的代码-ASPX
<asp:Repeater ID="rptCertificate" runat="server">
<ItemTemplate>
<div class="form-group">
<div class="col-xs-9">
<div class="row">
<div class="col-xs-12">
<b><span class="text-title" style="text-decoration:solid" id="lblCertName" runat="server" Text='<%#Eval("CertificateName") %>'></span></b>
</div>
<div class="col-xs-12">
<span id="lblCertLicenseNo" runat="server" Text='<%#Eval("CertificateNo") %>'></span>
</div>
<div class="col-xs-12 space-between-row">
<div class="form-group small-form-group">
<label class="col-xs-4 col-sm-3 custom-control-data-label">Certificate Validity</label>
<span class="col-xs-4 col-sm-4 custom-control-data-output output-exp-item" id="lblValidityDate" runat="server" Text='<%#Eval("CertValidStart") %>'></span>
</div>
</div>
<div class="col-xs-12 space-between-row">
<div class="form-group small-form-group">
<label class="col-xs-4 col-sm-3 custom-control-data-label">Certificate Authorized By</label>
<span class="col-xs-8 col-sm-9 custom-control-data-output output-exp-item" id="lblAuthority" runat="server" Text='<%#Eval("CertificateAuthority") %>'></span>
</div>
</div>
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
Aspx.vb
Sub ResourceName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
RepeaterCertificate(chkResourceName1.SelectedValue)
End Sub
Public Sub RepeaterCertificate(ByVal TechnicalProfileID As Int32)
attPage.SQLQuery = DC.Data_TechnicalResource("107", TechnicalProfileID.ToString)
DS = DA.GetSQLDataset(attPage.SQLQuery)
If DS IsNot Nothing AndAlso DS.Tables(0).Rows.Count > 0 Then
rptCertificate.DataSource = DS.Tables(0)
rptCertificate.DataBind()
End If
End Sub
此代码的输出是
Certificate Validity
Certificate Authorized By
Certificate Validity
Certificate Authorized By
它仅显示两个标签,但没有数据显示