具有相同数据源的Repeater内部的Detailsview [英] Detailsview inside Repeater with same datasource
问题描述
嗨伙计
我遇到了问题。我的页面上有一个Repeater控件。我在Page_Init为我的Reapter控件创建了一个数据源。在我的控制范围内,我有一些标签,其中包含来自我的数据源的一些数据。现在我已经在
里面添加了一个Detailsview控件来转发器控件来访问我的详细信息视图中显示的一些数据,但我似乎无法让它工作。我可以通过我的标签访问数据,但不能访问详细信息。
I have a problem. I have a Repeater control on my page. I have created a datasource at Page_Init for my Reapter control. Inside my control I have a few labels with some data in it from my datasource. Now I have added a Detailsview contol inside the repeater control to access some data to show in my detailsview but i cannot seem to get it to work. I can access data throught my labels but not detailsview.
任何帮助都将不胜感激。谢谢。这是我的代码:
Any help would be appreciated. Thanks. Here is my code:
< ; asp : Repeater
ID =" Repeater1"
runat ="服务器&现状t;
DataSourceID =" SchemeDataSource1">
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SchemeDataSource1">
< HeaderTemplate > < table >
<HeaderTemplate><table>
< / HeaderTemplate >
</HeaderTemplate>
< ItemTemplate >
< tr
style =" border :
2px
solid
#000000 ; ">
<tr style="border: 2px solid #000000;">
< td > PRENO
< asp : 标签
ID =" lblPreno"
runat =" server"
文字 =' <%#
Bind(" PRENR")%> '>< / asp : 标签 >
<asp:Label ID="lblPreno" runat="server" Text='<%# Bind("PRENR") %>'></asp:Label>
每月优惠
< asp : 标签
ID =" lblPremium"
runat =" server"
文字 =' <%#
Bind(" PREMIUM")%> '>< / asp : 标签 >
<asp:Label ID="lblPremium" runat="server" Text='<%# Bind("PREMIUM") %>'></asp:Label>
< span style ="color:#0000ff; font-size:small"> < / td >
</td>
< span style ="color:#0000ff; font-size:small"> < / tr >
</tr>
< span style ="color:#0000ff; font-size:small"> < tr >
<tr>
< span style ="color:#0000ff; font-size:small"> < td >
<td>
关系:[
< asp : 标签
ID =" lblRelation"
runat =" server"
文字 =' <%#
Bind(" RELATION")%> '>< / asp : 标签 >
<asp:Label ID="lblRelation" runat="server" Text='<%# Bind("RELATION") %>'></asp:Label>
] UWCODE:[
< asp : 标签
ID =" lblUWFeeCode"
runat =" server"
文字 =' <%#
Bind(" UWFEECODE")%> '>< / asp : 标签 >
<asp:Label ID="lblUWFeeCode" runat="server" Text='<%# Bind("UWFEECODE") %>'></asp:Label>
] [
< asp : 标签
ID =" lblDescription"
runat =" server"
文字 =' <%#
Bind(" DESCRIPTION")%> '>< / asp : 标签 >
<asp:Label ID="lblDescription" runat="server" Text='<%# Bind("DESCRIPTION") %>'></asp:Label>
]
< / td >
</td>
< span style ="color:#0000ff; font-size:small"> < / tr >
</tr>
< tr >
<tr>
< span style ="color:#0000ff; font-size:small"> < td >
<td>
< span style ="color:#0000ff; font-size:small"> < asp : 标签
ID =" Label1"
runat =" server"
文字 =" NO EARNER"
<asp:Label ID="Label1" runat="server" Text="NO EARNER"
BorderStyle =" Solid"
BorderWidth =" 2px">< / asp : 标签 >
BorderStyle="Solid" BorderWidth="2px"></asp:Label>
< span style ="color:#0000ff; font-size:small"> < / td >
</td>
< span style ="color:#0000ff; font-size:small"> < / tr >
</tr>
< span style ="color:#0000ff; font-size:small"> < tr >
<tr>
< td >
<td>
<%
- BROKER R
--BROKER R
< asp:Label ID =" Label3" runat =" server" Text ='<%#Bind(" PREMIUM_BROKER_AMOUNT")% >'>< / asp:Label>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("PREMIUM_BROKER_AMOUNT") %>'></asp:Label>
BRANCH R
< asp:Label ID =" Label4" ; runat =" server" Text ='<%#Bind(" PREMIUM_BRANCH_AMOUNT")%>'>< / asp:Label>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("PREMIUM_BRANCH_AMOUNT") %>'></asp:Label>
AGENT R
< asp:Label ID =" Label5" runat =" server" Text ='<%#Bind(" PREMIUM_AGENT_AMOUNT")%>'>< / asp:标签>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("PREMIUM_AGENT_AMOUNT") %>'></asp:Label>
REP R
< asp:Label ID =" Label6" runat =" server" Text ='<%#绑定(" PREMIUM_REP_AMOUNT")%>'>< / asp:标签>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("PREMIUM_REP_AMOUNT") %>'></asp:Label>
ADMIN R
< asp:标签ID =" Label7" runat =" server" Text ='<%#Bind(" PREMIUM_ADMIN_AMOUNT")%>'>< / asp:Label>
<asp:Label ID="Label7" runat="server" Text='<%# Bind("PREMIUM_ADMIN_AMOUNT") %>'></asp:Label>
JV R
< asp:Label ID =" Label8" runat =" server" Text ='<%#Bi nd(" PREMIUM_JV_AMOUNT")%>'>< / asp:标签>
<asp:Label ID="Label8" runat="server" Text='<%# Bind("PREMIUM_JV_AMOUNT") %>'></asp:Label>
< br /> -
<br />--
%>
%>
<%
- < asp:DetailsView ID =" DetailsView1" runat =" server" Height =" 50px" Width =" 125px" DataSourceID =" PremiumDataSource1">
--<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" DataSourceID="PremiumDataSource1">
< Fields>
<Fields>
< asp:TemplateField>
<asp:TemplateField>
< ItemTemplate>
<ItemTemplate>
BROKER
< asp:Label runat =" server" Text ='<%#Eval(" PREMIUM_BROKER_AMOUNT" ;)%>'>< / asp:标签>
<asp:Label runat="server" Text='<%# Eval ("PREMIUM_BROKER_AMOUNT") %>'></asp:Label>
< / ItemTemplate>
</ItemTemplate>
< / asp:TemplateField>
</asp:TemplateField>
< / Fields>
</Fields>
< / asp:DetailsView> -
</asp:DetailsView>--
%>
%>
< br /
/>
<br/ />
< span style ="color:#0000ff; font-size:small"> < hr
/>
<hr />
< span style ="color:#0000ff; font-size:small"> < / td >
</td>
< / tr >
</tr>
< / ItemTemplate >
</ItemTemplate>
< FooterTemplate >
<FooterTemplate>
< / table >
</table>
< / FooterTemplate >
</FooterTemplate>
< / asp : Repeater >
推荐答案
Hello PervBoy23
Hello PervBoy23
你最好提出问题到 http://forums.asp.net 论坛。
You better move the question to the http://forums.asp.net forum.
它是这不是一个VB问题所以很难在这里得到答案。
it is not a VB question so it is difficult to get an answer here.
Dennis
这篇关于具有相同数据源的Repeater内部的Detailsview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!