repeater

asp.net In a repeater is it possible to call a public function from another class?

那年仲夏 提交于 2019-12-01 22:32:04
Say I have this repeater which makes use of a public function called Test in the code-behind. <asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate> <table> </HeaderTemplate> <ItemTemplate> <tr> <td><%# Eval("MyCol1")%></td> <td><%# Eval("MyCol2")%></td> <td><%# Test((int)Eval("MyCol1"))%></td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> In my code-behind, I have this function public string Test (int Value) { return "Test"+Value.ToString(); } This works fine but in my website I will have similar repeaters on various pages and most of them will need

asp.net In a repeater is it possible to call a public function from another class?

送分小仙女□ 提交于 2019-12-01 21:57:18
问题 Say I have this repeater which makes use of a public function called Test in the code-behind. <asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate> <table> </HeaderTemplate> <ItemTemplate> <tr> <td><%# Eval("MyCol1")%></td> <td><%# Eval("MyCol2")%></td> <td><%# Test((int)Eval("MyCol1"))%></td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> In my code-behind, I have this function public string Test (int Value) { return "Test"+Value.ToString(); } This

Hide Repeater columns based on user privileges

落爺英雄遲暮 提交于 2019-12-01 21:22:07
问题 Can somebody explain to me how to hide a repeater column based on the user privileges. Say I have: <asp:Repeater ID="repeater" runat="server> <HeaderTemplate> <table id="table_id"> <tr> <th>Name</th> <th>Secret Info</th> <tr> </HeaderTemplate> <ItemTemplate> <tr> <td><asp:Label ID="Label1" runat="server" Text='<%# Eval("Name") %>' /></td> <td><asp:Label ID="Label1" runat="server" Text='<%# Eval("SecretInfo") %>' /></td> <tr> <ItemTemplate> <AlternatingItemTemplate> <tr> <td><asp:Label ID=

Find Label Control in Repeater Asp.net

巧了我就是萌 提交于 2019-12-01 21:09:37
I am using repeater and I want to find the label control in my repeater. here is my code <asp:Repeater ID="friendRepeater" runat="server"> <table cellpadding="0" cellspacing="0"> <ItemTemplate> <tr style=" width:700px; height:120px;"> <td> <div style=" padding-left:180px;"> <div id="leftHandPost" style="float:left; width:120px; height:120px; border: medium solid #cdaf95; padding-top:5px;"> <div id="childLeft" style=" padding-left:5px;"> <div id="photo" style=" border: thin solid black; width:100px;height:100px;"> <asp:Image id="photoImage" runat="server" ImageUrl='<%# String.Concat("Images/",

Find Controls nested inside Repeater Control

自闭症网瘾萝莉.ら 提交于 2019-12-01 21:01:42
问题 I'm trying to find the values of TextBoxes which are rendered in a Repeater though a UserControl, i.e. the Repeater has a Placeholder for the UserControl, and inside the UserControl is where the TextBox markup actually exists. I've done this before with TextBoxes directly inside of a Repeater before, which was fairly straight forward, and I'm wondering why this apparently can't be accomplished the same way. Here is the Default page with the Repeater, which contains a Placeholder... <asp

Create a HTML table with an ASP repeater, repeating horizontally

痴心易碎 提交于 2019-12-01 17:39:14
问题 I'm trying to build a HTML table using an ASP repeater: <asp:Repeater ID="RepeaterVersionsForPie" runat="server"> <ItemTemplate> <table id="VersionsTable" > <tr> <th> <%#Eval("nameVersion")%> </th> </tr> </ItemTemplate> <ItemTemplate> <tbody> <tr> <td tag="<%#Eval("idVersion")%>"> <%#Eval("NumberOfCompaniesUsingThisVersion")%> </td> </tr> </tbody> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> This is a basic table which consists in two lines and X columns . The

Repeater and add columns to header and itemtemplate on page load

喜你入骨 提交于 2019-12-01 17:08:58
I haven't used repeaters for much more than showing data from a datatable. I am building a grid that that shows a list of users and columns of roles that the user has been assigned, shown with checkboxes (shown with true/false below but pretent they are checkboxes). ex. |Rep Name|Caller|Closer|Manager|SuperUser| |Bob |True |true | false | false | |Tom |false |false |True | True | Basically using it for roles management. However the roles may change later on so I want to load the roles(headers and items) dynamically into the repeater. I am not sure how to do this or if it is even possible. I

Is there a repeater control in C# windows form in Visual 2010? Or an alternative?

旧时模样 提交于 2019-12-01 15:22:58
Is there a repeater control in C# windows form in Visual 2010 ? Or an alternative ? Yes there is. From the Visual Studio Toolbox go to section Visual Basic PowerPacks and there you will find a DataRepeater control. Even if it says VB PowerPack it works with C# as well. It will add a reference to following two assemblies: Microsoft.VisualBasic Microsoft.VisualBasic.PowerPacks.Vs Original answer : Repeater in .NET Framework 4 . Wrong , thanks for the comments, only works in WebForms, not in WinForms. What you could use is UserControl , create your template, and use it as a Repeater. 来源: https:/

Is there a repeater control in C# windows form in Visual 2010? Or an alternative?

故事扮演 提交于 2019-12-01 14:16:54
问题 Is there a repeater control in C# windows form in Visual 2010 ? Or an alternative ? 回答1: Yes there is. From the Visual Studio Toolbox go to section Visual Basic PowerPacks and there you will find a DataRepeater control. Even if it says VB PowerPack it works with C# as well. It will add a reference to following two assemblies: Microsoft.VisualBasic Microsoft.VisualBasic.PowerPacks.Vs 回答2: Original answer : Repeater in .NET Framework 4. Wrong , thanks for the comments, only works in WebForms,

Send string with QueryString in Repeater Control in ASP.net

╄→尐↘猪︶ㄣ 提交于 2019-12-01 12:50:09
I use a Repeater Control for showing the data in my WebSite. I use a HyperLink in the Repeater Control for showing one field of my table in the database. When you click, I want that link go to another page and send a string to that [page] with a QueryString. I don't know how I do that - can you explain how to do it? I am using Linq in ASP.net. <asp:HyperLink ID="HyperLink3" NavigateUrl='<%#Eval("ID_Message","~/ADMIN/Reply.aspx?ID={0}") %>' runat="server">OK</asp:HyperLink> Let's start with the format of the QueryString. The QueryString looks like the following: http://www.mysite.com/somepage