如何在中继器中使用文字用户控件 [英] How Do I Use Literal User Control In The Repeater

查看:149
本文介绍了如何在中继器中使用文字用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,我在网页上使用转发器进行文字控制



但我在构建时遇到错误

这里是我的代码



代码背后

-----------

Scheme.Text = Convert.ToString(dtPOADetails.Rows(0)(SCHEME))

Scheme_Number.Text = Convert.ToString(dtPOADetails.Rows(0)(SCHEME_NUMBER))

person_id.Text = Convert.ToString(dtPOADetails.Rows(0)(PERSON_ID))





aspx

----

Hi friends , here i am using literal control using repeater in my web pages

but i got error while build
here is my code

code behind
-----------
Scheme.Text = Convert.ToString(dtPOADetails.Rows(0)("SCHEME"))
Scheme_Number.Text = Convert.ToString(dtPOADetails.Rows(0)("SCHEME_NUMBER"))
person_id.Text = Convert.ToString(dtPOADetails.Rows(0)("PERSON_ID"))


aspx
----

<asp:Repeater ID="Repeater1" runat="server" >
<HeaderTemplate>
<table border="0" cellpadding="2" cellspacing="6" class="gridStyle" align="center" width="100%">
 <tr>
<th nowrap="noWrap" style="font-weight: bold"> SCHEME</th>
<th nowrap="noWrap" style="font-weight: bold"> SCHEME_NUMBER</th>
<th nowrap="noWrap" style="font-weight: bold"> PERSON_ID</th>
</tr>
</Headertemplate>
<itemtemplate>
<table><tbody><tr>
<td> <asp:Literal runat="server" ID="Scheme" Text='<%#Eval("Scheme") %>'></td>

<td> <asp:Literal runat="server" ID="Scheme_Number" Text='<%#Eval("Scheme_Number") %>'></td>

<td> <asp:Literal runat="server" ID="person_id" Text='<%#Eval("person_id") %>'></td>
</tr></tbody></table>





i我这样得到错误:

1.Scheme未申报。由于其保护级别,它可能无法访问。

2.Scheme_Number未声明。由于其保护级别,它可能无法访问。

3.person_id未声明。由于它的防护等级,它可能无法进入。





尽快回复我



提前感谢



Velsamy



i am getting error like this :
1.Scheme is not declared. It may be inaccessible due to its protection level.
2.Scheme_Number is not declared. It may be inaccessible due to its protection level.
3.person_id is not declared. It may be inaccessible due to its protection level.


Reply me as soon as possible

thanks in advance

Velsamy

推荐答案

要获得转发器内的控制权需要用户找到控件属性如



To Get the control within repeater you need to user find control property like

Literal Scheme= (Literal )(Repeater1.FindControl("Scheme"));





现在,如果你想得到每一行数据,那么你必须循环这个转发器并在每一行逐个获得字面值。



Now, if you want to get each row data, then you have to loop on this repeater and get literal one by one in each row.


链接可以帮助你进行分页。



http://www.4guysfromrolla.com/articles/081804- 1.aspx [ ^ ] < br $> b $ b

使用中继器控制分页 [ ^ ]



在ASP.NET中使用Repeater控件进行分页 [ ^ ]



http://www.dotnetcurry.com/showarticle.aspx?ID=345 [ ^ ]
Links may help you for paging.

http://www.4guysfromrolla.com/articles/081804-1.aspx[^]

Pagination with Repeater Control[^]

Paging with Repeater control in ASP.NET[^]

http://www.dotnetcurry.com/showarticle.aspx?ID=345[^]


这篇关于如何在中继器中使用文字用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆