repeater

Dynamically adding a user control to a repeater

天涯浪子 提交于 2019-12-05 10:17:40
I have a class (MyClass) which represents a nested hierarchy, so the class has a property which is a collection of MyClass. MyClass also has a title property To show it on a web page, I was hoping to create a user control which had a repeater. In the item template I would have literal to display the title property, and on the ItemCreated event of the repeater, I would create a new instance of the usercontrol, and add it into the current item in the repeater. My problem is, when the Page_Load event in the usercontrol fires, if the control was dynamically added, the repMyClass repeater poroperty

ng-repeat without HTML element (this time really without any)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 10:15:31
I want to get something like: Line 1<br> Line 2<br> Line 3<br> Line 4<br> Line 5<br> using ng-repeat. Lines should be separated by nothing except <br> Here is a simplistic directive that hard-codes the <br> HTML: <p hidden-repeat="lines"></p> app.directive('hiddenRepeat',function($parse){ return { link: function(scope, elem, attr){ var data = $parse(attr.hiddenRepeat)(scope); if(data){ for (var i=0;i< data.length;i++){ elem.append(data[i]+ "<br />"); } } } }; }); See it in action: http://plnkr.co/edit/Y8eahPYmBr5ohbWCInde?p=preview This solution allows you to specify the directive in an

How to fire a button event from inside a repeater?

大憨熊 提交于 2019-12-05 06:45:10
问题 I have done my research but can't find an efficient way to do the following in VB : Each button should fire the same event. The button event saves every repeater item and so each event is not unique. I am aware I can use the ItemCommand option but have not been able to get it working as desired. ASP.NET Inside Repeater Item <asp:Button ID="btnSave" RunAt="Server"/> VB.NET Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) sqlConn.Open() For Each Item As

How to nest repeaters in asp.net

◇◆丶佛笑我妖孽 提交于 2019-12-05 06:05:07
I need to know how to nest repeaters within a user control. The html side of things is fine, it's the binding and code behind I need help with. I've only been able to find examples using an sql data source, which doesn't really help. My repeaters look like this: <asp:Panel ID="pnlDiscipline" runat="server" CssClass=""> <asp:Repeater ID="rptDiscipline" runat="server"> <ItemTemplate> <h4><%#Eval("Discipline")%></h4> <ul> <asp:Repeater ID="rptPrograms" runat="server"> <ItemTemplate> <li><asp:HyperLink runat="server" Text='<%#Eval("Name") %>' NavigateUrl='<%#Eval("Link") %>'></asp:HyperLink> <%

Render empty repeater

可紊 提交于 2019-12-05 04:09:00
When Repeater contains no items it's not get rendered in HTML at all, even HeaderTemplate or FooterTemplate . I need to manipulate it on client-side even if it's empty. Is there any way to always render Repeater in HTML? Saurabh In the <FooterTemplate> , add a Label with some empty data text and set its visible property to false. <FooterTemplate> <table> <tr> <td> <asp:Label ID="lblEmptyData" Text="No Data To Display" runat="server" Visible="false"> </asp:Label> </td> </tr> </table> </FooterTemplate> Now check the the data while binding repeater, if no rows return then make label visible

Access Parent Repeaters DataItem Property

流过昼夜 提交于 2019-12-04 20:51:34
问题 I have a control that has a Repeater, rptReferrals, that runs through a list of Entity objects, Referrals. The Referrals object has a reference to another table called Answers, which is a list of Answers that got submitted for the user. rptReferrals will bind a child repeater, rptQuestionnaire to a List of Questions for the person I am logged in with, which is not connected to the Referrals object it is bound to. Here is the aspx code: <asp:Repeater runat="server" ID="rptReferrals"

Multiple popups inside repeater

99封情书 提交于 2019-12-04 18:32:40
I am creating a mobile site where I have a list of pictorials of motorcycle models. I created the list with each image as a list-item and also added a div with the data-rel="popup" inside the list-item . Everything compiles and functions correctly, but any image I click in the list only shows the first image. I.e., when the 3rd list-item in the list is clicked and the popup is opened, image #1 is displayed. This is also true for every link in the list. Do you know why it is doing this? I know I can go around this by creating another jquery page and just redirect to that, but it's much cleaner

Angular.js: filter ng-repeat by absence in array

孤街浪徒 提交于 2019-12-04 17:25:48
问题 I need to filter items in ng-repeat so that only the items which not appear in alreadyAddedValues() array will be shown: <ul class="dropdown-menu"> <li ng-repeat="v in values() | filter: { ????? } ">{{value.name}}</li> </ul> $scope.values() = function(){ ................ } $scope.alreadyAddedValues() = function() { //returns an array } The search of an already added value should perform by value.shortName 回答1: You can, for example, use a custom function to do the filtering: <li ng-repeat="v

ASP.NET - Add rows to repeater at runtime

雨燕双飞 提交于 2019-12-04 16:02:38
Public Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack = False Then Dim ds1 As New List(Of Link) For i = 1 To x Dim h As New Link ds1.Add(h) h.Text = "ssss" h.URL = "yyyyy" Next rptMenu.DataSource = (ds1) Else rptMenu.DataSource = ViewState("ds1") End If rptMenu.DataBind() End Sub Protected Sub addFeild() Dim ds1 As List(Of Link) = rptMenu.DataSource Dim h As New Link ds1.Add(H) rptMenu.DataBind() End Sub Private Sub Menu_PreRender(ByVal sender As Object, ByVal e As System

how to bind inner repeater?

﹥>﹥吖頭↗ 提交于 2019-12-04 15:43:12
i have a repeater inside another repeater. now i want to bind the inner repeater. but i m getting error of "Object reference not set to an instance of an object.". my code is Protected Sub rep_test_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rep_test.ItemDataBound Dim dt As New DataTable dt = obj.getdata() Dim innerRepeater As Repeater = DirectCast(e.Item.FindControl("innerRepeater"), Repeater) innerRepeater.DataSource = dt innerRepeater.DataBind() End Sub my source code is <asp:Repeater ID="rep_test" runat="server"> <ItemTemplate>