repeater

Why is the footer-item not included in Repeater.Items?

时光总嘲笑我的痴心妄想 提交于 2019-12-22 06:53:46
问题 I need to get a value from a textbox inside a FooterTemplate in the OnClick event of a button. My first thought was to loop through the items-property on my repeater, but as you can see in this sample, it only includes the actual databound items, not the footer-item. ASPX: <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> Item<br /> </ItemTemplate> <FooterTemplate> Footer<br /> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </FooterTemplate> </asp:Repeater> <asp:Button ID=

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

耗尽温柔 提交于 2019-12-22 06:53:07
问题 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> 回答1: 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:/

Maintaining viewstate of a repeater

隐身守侯 提交于 2019-12-22 05:07:25
问题 I have a problem whereby the viewstate of a repeater i.e. the controls within the repeater are not maintaing their viewstate. I have the following: Repeater 1: <asp:Repeater ID="rptImages" runat="server"> <ItemTemplate> <asp:LinkButton Text="Add" CommandName="Add" CommandArgument=<%# Eval("ID") %> runat="server" /> </ItemTemplate> </asp:Repeater> When the link button is clicked the value of the CommandArgument is stored in a hidden field on the page. Upon postback I can't get the value of the

how to bind inner repeater?

醉酒当歌 提交于 2019-12-21 20:23:34
问题 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

ASP.NET DataGrid within a Repeater

冷暖自知 提交于 2019-12-21 19:56:02
问题 I have a table that has two columns: CommunityID PersonID And A "People" table that has (among other things): FirstName LastName I would like to display a different DataGrid for each community, each datagrid having only the people that are part of that community. I would like to do this without using 4 seperate SqlDataSources. A Repeater looks like a good way, with a DataGrid inside the ItemTemplate, but I can't seem to make heads or tails of getting that to work with the different values for

Using an ASP.NET repeater with an array?

房东的猫 提交于 2019-12-21 07:53:03
问题 This may be a silly question but I was writing a quick test page and realised that I didn't know how to bind an array or ArrayList of strings, for example, to an ASP.NET Repeater. I experimented a bit. <asp:Repeater ID="rptImages" runat="server"> <HeaderTemplate> <h3>Items</h3> </HeaderTemplate> <ItemTemplate> <p style="background-color:Black;color:White"><%#Eval(Container.DataItem.ToString())%></p> </ItemTemplate> <FooterTemplate> <h4>End of Items</h4> </FooterTemplate> </asp:Repeater> Am I

Using an ASP.NET repeater with an array?

牧云@^-^@ 提交于 2019-12-21 07:52:51
问题 This may be a silly question but I was writing a quick test page and realised that I didn't know how to bind an array or ArrayList of strings, for example, to an ASP.NET Repeater. I experimented a bit. <asp:Repeater ID="rptImages" runat="server"> <HeaderTemplate> <h3>Items</h3> </HeaderTemplate> <ItemTemplate> <p style="background-color:Black;color:White"><%#Eval(Container.DataItem.ToString())%></p> </ItemTemplate> <FooterTemplate> <h4>End of Items</h4> </FooterTemplate> </asp:Repeater> Am I

how to add sorting function in repeater in asp 2.0?

℡╲_俬逩灬. 提交于 2019-12-20 15:25:57
问题 I m using asp 2.0, I need an requirement for sorting the repeater control. I search over the Internet but i could nt find the correct solution. If anyone knows the answer please help to solve my problem. 回答1: You need to sort the collection before binding to the repeater. If you want to dynamically sort on post backs, sort in the event handler before re-binding to the repeater. 回答2: This article explains how to add sort functionality to a Repeater or a DataList control. It might help to your

How to access datasource fields in an ASP.NET Repeaters ItemDataBound event?

大城市里の小女人 提交于 2019-12-20 09:49:36
问题 I have a Repeater control that is being bound to the result of a Linq query. I want to get the value of one of the datasource's fields in the ItemDataBound event, but I'm not sure how to do this. 回答1: You can use: e.Item.DataItem . Example: Repeater.ItemDataBound Event // This event is raised for the header, the footer, separators, and items. void R1_ItemDataBound(Object Sender, RepeaterItemEventArgs e) { // Execute the following logic for Items and Alternating Items. if (e.Item.ItemType ==

Error: Procedure or function expects parameter which was not supplied

给你一囗甜甜゛ 提交于 2019-12-20 06:57:07
问题 Currently, my program in Visual Studio dynamically adds my data from my Repeater into my database. Now I need to add the ID, my EventId and FormId, which I collected manually outside of the Repeater. I need to add this in: sqlCmd.Parameters.Add("@EventId", SqlDbType.Int).Value = eventId; sqlCmd.Parameters.Add("@FormId", SqlDbType.Int).Value = formId; However with how my code is setup, it gives an error when I add this code that says: Additional information: Procedure or function