repeater

ASP.NET RadioButtonList in Repeater?

為{幸葍}努か 提交于 2019-12-10 17:52:52
问题 aspx file: <asp:Repeater ID="Repeater_sorular" runat="server"> <HeaderTemplate> </HeaderTemplate> <ItemTemplate> <div class="div_soru"> <div class="div_soru_wrapper"> <%#Eval("Subject")%> <asp:RadioButtonList ID="RadioButtonList_secenekler" runat="server" Visible='<%# Eval("TypeId").ToString() == "1" %>' DataSource='<%#Eval("Secenekler")%>' DataTextField='<%#Eval("OptionName")%>' DataValueField='<%#Eval("OptionId")%>'> </asp:RadioButtonList> <asp:CheckBoxList ID="CheckBoxList_secenekler"

<%: %> Syntax for HTML Encoding in a repeater

你说的曾经没有我的故事 提交于 2019-12-10 16:17:58
问题 Since .NET 4 its possible to use the <%: %> syntax for HTML Encoding of text. In a repeater I use the following syntax to display data <%# DataBinder.Eval(Container.DataItem, "fieldlabel")%> The only way I know of to encode the output in the repeater is by using "Server.HtmlDecode". Is it possible to use the new <%: %> in a repeater just in combination with databinding so that I can remove the ugly HtlmDecode syntax. Or is an extention method my only option to improved the readability? 回答1:

Is there a similar way to AlternateItemTemplate to do this

自古美人都是妖i 提交于 2019-12-10 16:03:25
问题 I know that with a repeater I can use AlternatingItemTemplate and SeparatorTemplate to adopt a variety of alternating items or for the latter a consistent style / attribute between items. But in my latest task, I require a SeperatorTemplate but only after every 3 items! I know I can do this in the ItemDataBound and have a cheeky runningItemCount++ then use runningItemCount % 3 == 0 to place this in. I also know I can do this using a repeater within a repeater. Just mentioning it is dirty... .

get value from textbox within repeater asp.net c#

与世无争的帅哥 提交于 2019-12-10 15:43:00
问题 I've been trying to get this working for a couple of hours now but nothing from google could help me fix the problem. I have a very simple repeater control: <asp:Panel ID="userDefDiv" Visible="false" runat="server"> <asp:Repeater ID="userDefRepeater" EnableViewstate="false" runat="server"> <ItemTemplate> <asp:TextBox ID="TextBox1" runat="server" EnableViewState="false"></asp:TextBox><br/> </ItemTemplate> </asp:Repeater> </asp:Panel> the userDefDiv panel is inside another panel, which is

ASP.Net repeater item.DataItem is null

给你一囗甜甜゛ 提交于 2019-12-10 15:25:53
问题 Within a webpage, upon loading, I fill a dataset with two table with a relation between those tables and then load the data into a repeater with a nested repeater. This can also occur after the user clicks on a button. The data gets loaded from a SQL database and the repeater datasource is set to the dataset after a postback. However, when ItemDataBound occurs the Item.Dataitem is always null. Why would this occur? Here is the databind code: this.rptCustomSpaList.DataSource = ds; this

Horizontal orientation in Repeater control

前提是你 提交于 2019-12-10 15:11:23
问题 I have a Repeater control used to display uploaded images. How can I show the images in the repeater horizontally? How can i give the caption to the bottom of picture in this? 回答1: assuming you have some code like this: <asp:repeater ...> </asp:repeater> just inject "<itemtemplate>" with some html code with the look and feel you want to. nothing special about showing horizontal or vertical it just depends on what html tags you use inside item templates. 回答2: If you don't especially need a

asp:repeater collapsing table rows - Updated

ぐ巨炮叔叔 提交于 2019-12-10 14:04:42
问题 I'm wondering if someone has a creative solution to my problem. I have a repeater that is populated from my database and it is as follows: <asp:Repeater ID="ResultsTableRepeater" runat="server" OnPreRender="ResultsTableRepeater_PreRender"> <HeaderTemplate> <table class="td-table-bordered" style="font-size: small; width: 90%"> <tr> <th>Change #</th> <th>Change Title</th> <th>Change Description</th> <th>Clarity Id</th> <th>Package Description</th> <th>Package Name</th> <th>Package Status</th>

How to use button in repeater control?

跟風遠走 提交于 2019-12-10 12:53:46
问题 I am using asp.net 3.5 with c#.I want to invoke button click event inside repeater control. <asp:Repeater ID="rptFriendsList" runat="server" onitemcommand="rptFriendsList_ItemCommand"> <ItemTemplate> <asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/Contents/Images/save_button.png" CommandName="Schedule" UseSubmitBehavior="False" /> </ItemTemplate> </asp:Repeater> but when i click to a button its giving an error "Invalid postback or callback argument. Event validation is enabled using

resize div width down based on the amount of data contained within repeater and up to a max-width

会有一股神秘感。 提交于 2019-12-10 12:03:25
问题 I have a repeater wrapped in a div which displays results as horizontal text. The div is set to a maximum width of 450px which causes the results to wrap onto the next line which is perfect, but the width remains 450px when there are less than 450px width's worth of results. I would like the div to resize down to the width of the results. This is the data wrapping ok in the div: This is what happens when there are a small number of results: This is what I would like to happen: Here is my css

Inject Index of Current item when binding to a repeater

半世苍凉 提交于 2019-12-10 09:34:49
问题 I am binding a List<HtmlImage> to a repeater Its actually a nested repeater and the list is one of the properties that the parent repeater is binding to I want to spit out the index of the current dataitem into the id property of the <li> I've put a comment where I want the index to appear below I have the following: <asp:Repeater ID="ImageListRepeater" runat="server" DataSource='<%# DataBinder.Eval(Container.DataItem, "Images") %>'> <HeaderTemplate><ul></HeaderTemplate> <ItemTemplate> <li id