repeater

User Control Inside Repeater

老子叫甜甜 提交于 2019-11-30 04:57:59
I have a UserControl inside a repeater. The repeater's datasource is from SQL Server. User Control's .cs - MoviePanel.ascx.cs: public int myMovieID { get; set; } public string myMovieName { get; set; } public string myMovieDescription { get; set; } protected void Page_Load(object sender, EventArgs e) { MovieIDLbl.Text = myMovieID.ToString(); MovieNameLbl.Text = myMovieName; DescriptionLbl.Text = myMovieDescription; } ASPX Page: <asp:Repeater ID="Repeater1" DataSourceID="ListOfMoviesDS" runat="server"> <ItemTemplate> <uc1:MovieDetailPanel runat="server" myMovieID='<%# Eval("MovieID") %>'

DropDownList inside Repeater: How to handle SelectedIndexChange and get DataItem?

我是研究僧i 提交于 2019-11-30 04:43:52
问题 I am putting a DropDownList with AutoPostBack inside a Repeater. (The ListItems are populated on the repeater's ItemDataBound) <asp:Repeater ID="rptWishlist" OnItemCommand="rptWishlist_ItemCommand" onItemDataBound="rptWishlist_ItemDataBound" runat="server"> <ItemTemplate> ... <asp:DropDownList ID="ddlSize" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSize_SelectedIndexChanged" /> ... Firstly, this function was not even fired on post back protected void ddlSize

nested dictionary to nested repeater asp.net c#

匆匆过客 提交于 2019-11-30 04:37:20
问题 I'm making an asp.page that will display hierarchical information about company assets. To grab the data I used a lambda expression: FASAssetInfoDataContext fasInfo = new FASAssetInfoDataContext(); var data = from g in fasInfo.Asset_Informations where g.Department.Substring(0, 3) == p select g; Dictionary<string, Dictionary<string, List<info>>> branch = data.GroupBy(e => e.Location) .ToDictionary(g => g.Key, g => g.GroupBy(gl => gl.G_L_Asset_Acct_No) .ToDictionary(gl => gl.Key, gl => gl

How can I hide a repeater in ASP.NET C# if the DataSource contains no items?

别来无恙 提交于 2019-11-29 19:55:27
问题 I have an ASP.NET page that uses a repeater nested within another repeater to generate a listing of data. It's to the effect of the following: <asp:Repeater> <ItemTemplate> <span><%#Eval("Data1") %></span> <!-- and many more --> <asp:Repeater DataSource='<%#Eval("Data2")%>'> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate> <li><%#Container.DataItem%></li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater> </ItemTemplate> </asp:Repeater> In the (C#) code-behind I'm

If statement in repeaters ItemTemplate

夙愿已清 提交于 2019-11-29 18:24:21
问题 I'm using an ASP.NET Repeater to display the contents of a <table> . It looks something like this: <table cellpadding="0" cellspacing="0"> <asp:Repeater ID="checkboxList" runat="server" OnItemDataBound="OnCheckboxListItemBound"> <ItemTemplate> <tr id="itemRow" runat="server"> <td> Some data </td> </tr> </ItemTemplate> </asp:Repeater> </table> It works fine, but i'd like to have an if() statement inside the ItemTemplate so i can conditionally determine if i want to print out a <tr> tag. So i'd

Bind 5 items in each row of repeater

Deadly 提交于 2019-11-29 15:04:21
I have a set of items coming from the database. Their number may vary. I have bound them in a repeater. Now my following example will explain what I want: I have 11 items coming from database, I want them to be grouped in terms of 5 items per row. 1st row: 5 items. 2nd row: 5 items. 3rd row: 1 item. Currently, I am just binding them in a repeater. How do I do this? Yes. It is possible: <asp:Repeater ID="rptItems" runat="server"> <ItemTemplate> <asp:Literal runat="server" Text='<%# Eval("Value") %>'></asp:Literal> <div style="clear: both" runat="server" Visible="<%# (Container.ItemIndex+1) % 5

How to set up a breadcrumb in an ASP.net page

折月煮酒 提交于 2019-11-29 14:45:48
My folder hierarchy for the pages are (They are all in the same folder): Site.Master Default.aspx find_provider.aspx provider.aspx I have a Web.sitemap page set up: <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="~/Default.aspx" title="Home" description="Homepage"> <siteMapNode url="~/find_provider.aspx" title="Provider" description="Search for provider"> <siteMapNode url="~/provider.aspx" title="Profile" description="Shows each provider profile" /> </siteMapNode> </siteMapNode> </siteMap> I am calling in my

How to use linkbutton in repeater using C# with ASP.NET 4.5

南笙酒味 提交于 2019-11-29 14:13:57
In asp.net I have a table in database containing questions,date of submission and answers.On page load only questions appear.now i want to use any link which on clicking show answers and date specified in table data, either in textbox or label and clicking again on that link answer disappear again like expand and shrink on click. So what coding should i use for this in C#? Dr. Wily's Apprentice I believe you could handle the ItemCommand event of the Repeater. Place a LinkButton control for the link that you want the user to click in the Repeater's item template. Set the CommandName property of

VB.NET Repeater Simple Data Binding Without Datasource

有些话、适合烂在心里 提交于 2019-11-29 11:23:40
I've got a form that has to be a repeater on a webpage. I have a number parameter that tells me how many additional customer details are to be added. In this page I have a repeater control that needs to repeat items a set number of times. For each item there is a set of input boxes that needs an id appended to it. All I need to bind is a number for each additional input box ie <% #id %> . I dont know how to set up simple databind without a specific datasource, but just build one in a loop. <asp:Repeater ID="myRepeater" runat="server"> <HeaderTemplate> <div class="AdditionalRowTitle"> <div

How to FindControls in repeater control?

浪子不回头ぞ 提交于 2019-11-29 08:41:40
I want to enable or disable 'ParticipateBtn' depending on EventStartDate. I am getting this error:Object reference not set to an instance of an object. Start Date : <%# CheckEnability((DateTime)Eval("Event_Start_Date")) %> <asp:Button runat="server" ID="ParticipateBtn" CommandName="Participate" CommandArgument='<%# Eval("Event_Id") + "|" + Eval("Event_Name") + "|" + Eval("Volume") + "|" + Eval("Tournament_Id") %>' Text="Participate" />   </ItemTemplate> <FooterTemplate></FooterTemplate> <SeparatorTemplate> <hr style="color:Silver; height:1px;" /> </SeparatorTemplate> </asp:Repeater> The code