repeater

Asp.net/C# Get repeater row data through checkbox

风流意气都作罢 提交于 2019-12-12 03:05:18
问题 Hello i have a repeater that will present data as a table with checkbox for each row, so i want to show the checked rows data when a button is clicked. .aspx code: <asp:Repeater ID="rptItems" runat="server"> <HeaderTemplate> <table class="table table-bordered table-hover table-responsive table-striped table-condensed"> <tr> <th> </th> <th>Goods Desc</th> <th>Balance Units</th> <th>Exit Units</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td><asp:CheckBox ID="cbItem" runat="server" /></td>

Manage Hyperlink base on the condition in Repeater ASP.NET C#

余生颓废 提交于 2019-12-12 02:45:06
问题 How to manage Hyperlinks base on AttachmentID, In Inside link button there is two hyperlink to manage, If AttachmentID is "NA" Then Hyperlink ID one should visible else Hyperlink ID two should visible. I tried lots into google like this code not able to find. I tried using ItemCommand and ItemDataBound but did not understand this concept. The main concept to do this manage target="_blank". Below is my Repeater Code. <asp:Repeater ID="Repeater_News1" runat="server" OnItemDataBound="Repeater

Add CSS Class through a Repeater

一世执手 提交于 2019-12-12 02:18:58
问题 I have a repeater which dynamically generate tab links using Sitecore (sc:Link) like this: <asp:Repeater ID="rptTab" runat="server" OnItemDataBound="rptTab_ItemBound"> <ItemTemplate> <li id= "liTabTest" runat = "server" class="tab-label"> <asp:HyperLink onclick = "javascript: TabClick(this)" runat="server" id="aLink"> <sc:Link ID="hlTabLink" Field="scTabLink" runat="server" ></sc:Link> </asp:HyperLink> </li> </ItemTemplate> </asp:Repeater> I manipulate the CSS via JS: var loadURL; $(document)

How do i get my repeater results to appear line by line

时光毁灭记忆、已成空白 提交于 2019-12-12 01:57:40
问题 <p runat="server" id="pServices"> <asp:Repeater runat="server" ID="rptServices" OnItemDataBound="rptServices_OnItemDataBound"> <HeaderTemplate></HeaderTemplate> <ItemTemplate> <asp:Label runat="server" ID="lblService"></asp:Label> </ItemTemplate> <AlternatingItemTemplate> <asp:Label runat="server" ID="lblService"></asp:Label> </AlternatingItemTemplate> </asp:Repeater> </p> And in the code behind I have private void updatePageWithUserData(User UserProfile) { this.pProfile.InnerText =

How to get the next and previous row value in repeater item command?

断了今生、忘了曾经 提交于 2019-12-12 00:34:13
问题 Is there any way to get the next or previous row value of repeater on Item_Command event of repeater? 回答1: Try something like this... in your Item_Command handler: Button senderButton = (Button)sender; RepeaterItem currentRepeaterItem = (RepeaterItem)(senderButton.NamingContainer); int currentRepeaterItemIndex = currentRepeaterItem.ItemIndex; RepeaterItem previousRepeaterItem = MyRepeater.Items[currentRepeaterItemIndex-1]; RepeaterItem nextRepeaterItem = MyRepeater.Items

Format Data in an ASP.NET Repeater

一世执手 提交于 2019-12-11 16:40:08
问题 I have an ASP.NET web form that uses an ASP.NET Repeater. The data source for this repeater is a DataTable that includes a column called "City", and one called "State". In the ItemTemplate of the Repeater, I want to call a custom method I've written called "FormatLocation". This method is defined as: protected string FormatLocation(string city, string state) { string location = city; if (state.Length > 0) location += ", " + state.ToUpper(); return location; } I want to call this method when

Retrieve the value of td in repeater

穿精又带淫゛_ 提交于 2019-12-11 15:51:07
问题 I have a Repeater that contains a Table. I want to hide the some tablecells of the table in repeater item template Here is the ASPX source code: <ItemTemplate> <table style="width: 100%" align="center"> <tr> <td style="width: 60px;" align="center"> <img src="upload/companylogo/<%# Eval("companylogo") %>" /> </td> <td align="left"> <asp:Label runat="server" CssClass="lblcname" ID="Label1" Text='<%# Eval("companyname") %>' /></td> <td align="right"> <asp:Label runat="server" ID="Label2" Text='<

Checkbox for images in an ASP.NET repeater controls

被刻印的时光 ゝ 提交于 2019-12-11 15:23:11
问题 I am working with ASP.NET. I am using a repeater to display images, and I also am using a check box for each image. How can I select individual images and update their values as per image id? My code is: protected void Button3_Click(object sender, EventArgs e) { foreach (RepeaterItem ritem in Repeater1.Items) { CheckBox btn = ritem.FindControl("CheckBox1") as CheckBox; if (btn.Checked == true) { string chrck = btn.Text; } } } This my control which i have use : <asp:Repeater ID="Repeater1"

Get value of Id not displayed in the Repeater from a button event of a dialog

梦想的初衷 提交于 2019-12-11 13:46:04
问题 I'm having a problem trying to get the value of the ID item that has been clicked in an asp.net Repeater. My Repeater has an image that opens a dialog, and from that dialog opened, when I click Approve, I would like to get this value in the .cs file when I'm redirected because the ApproveChange_Click event. I'm not doing any DataBinder.Eval to the Id I want to retrieve in the Repeater. How can I accomplish that? If I use session variables, where I can set up the value in the .aspx page and

Using Ajax Accordion with Repeater

爱⌒轻易说出口 提交于 2019-12-11 11:39:47
问题 I have a Repeater control and now want to add it to an Accordion. It doesn't seems to work. How can I go about doing this? My Repeater: <ajaxToolkit:Accordion ID="accordion1" runat="server" CssClass="accordion" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" AutoSize="None" FadeTransitions="true" TransitionDuration="250" FramesPerSecond="40" RequireOpenedPane="false" SuppressHeaderPostbacks="true"> <Panes> <asp:Repeater ID=