repeater

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

China☆狼群 提交于 2019-11-28 08:59:41
问题 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"

Strange Error - CS0012: The type x is defined in an assembly that is not referenced

六眼飞鱼酱① 提交于 2019-11-28 08:56:06
The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'. I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the correct(same) version. The rest of application has no issues except for one .aspx page. The page in question has a repeater that displays a user control as one of its "fields". Upon binding a list of type y to the repeater I pass the user control a list of type x (a property of y) as shown here: <uc1:usercontrol id="ucusercontrol " runat="server"

Checkbox OnClick/ItemCommand in Repeater or DataList

≯℡__Kan透↙ 提交于 2019-11-28 07:59:50
问题 I need to do some server side logic on a row in my repeater when a CheckBox is clicked inside the repeater control. Anyone know how to go about this? The way I see it you cant fire item command and if you use the CheckBoxes OnClick you cant get the repeater row. 回答1: Here is a quick mock-up of how I have done similar in the past. <asp:Repeater id="repeater1" runat="server" OnItemDataBound="repeater1_OnItemDataBound" > <ItemTemplate> <asp:CheckBox ID="chk" runat="server" OnCheckedChanged=

Can't find control within asp.net repeater?

旧时模样 提交于 2019-11-28 06:50:39
I have the following repeater below and I am trying to find lblA in code behind and it fails. Below the markup are the attempts I have made: <asp:Repeater ID="rptDetails" runat="server"> <HeaderTemplate> <table> </HeaderTemplate> <ItemTemplate> <tr> <td><strong>A:</strong></td> <td><asp:Label ID="lblA" runat="server"></asp:Label> </td> </tr> </ItemTemplate> </asp:Repeater> </table> First I tried, Label lblA = (Label)rptDetails.FindControl("lblA"); but lblA was null Then I tried, Label lblA = (Label)rptDetails.Items[0].FindControl("lblA"); but Items was 0 even though m repeater contains 1

Formatting DataBinder.Eval data

谁说胖子不能爱 提交于 2019-11-28 04:56:52
How can I format data coming from a DataBinder.Eval statement in an ASPX page? For example, I want to display the published date of the news items in a particular format in the homepage. I'm using the ASP.NET 2.0 Repeater control to show the list of news items. The code for this goes like this: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSource1"> <HeaderTemplate><table cellpadding="0" cellspacing="0" width="255"></HeaderTemplate> <ItemTemplate> <tr><td > <a href='/content/latestNews.aspx?id=<%#DataBinder.Eval(Container.DataItem, "id") %>'> <asp:Label ID="lblNewsTitle"

Nested Repeaters and SqlDataSource Parameters

牧云@^-^@ 提交于 2019-11-28 01:57:48
I am using nested repeaters to build a table for reasons I won't discuss here, but what I'm looking to do is have two datasources, one for the top level repeater that will correspond to the rows, and one for the second level repeater that will return cells within a row. What I'm wondering, however, is if I can somehow specify a parameter in the nested repeater's datasource that is set a field in the results from the first datasource? Can I set a parameter to the value of a data binding expression? The reason I want to do this is I have two stored procedures. When the page is loaded I have a

asp.net radio button grouping

心已入冬 提交于 2019-11-27 20:04:14
I am currently having an issue with radio buttons and grouping. I have an asp radio button within a repeater control. I have the group name attribute set to "Customer". When the page loads, the radio buttons are not grouped. Instead of the id fields being set to the group name, it is setting the value fields of the radio buttons. I know that I have tried setting radio buttons up outside of a repeater control and have had the same issue. What is going on here? aspx <asp:Repeater ID="repCustomers" runat="server"> <HeaderTemplate> <table class="tableDefault" cellpadding="0" cellspacing="0" border

How to do AsyncPostBackTrigger for the LinkButton in the Repeater

孤人 提交于 2019-11-27 18:36:29
In my page, I have an LinkButton inside repeater, but the UpdatePanel cannot find the LinkButton to AsyncPostBackTrigger. Here is mycode.aspx <asp:ScriptManager ID="Test1" runat="server" /> <asp:UpdatePanel ID="TestUpdate" runat="server" UpdateMode="Always"> <ContentTemplate> <table width="100%"> <tr valign="top"> <td width="50%"> <asp:Repeater ID="productList" runat="server" onitemcommand="productList_ItemCommand"> <HeaderTemplate> <ul type="disc"> </HeaderTemplate> <ItemTemplate> <li> <asp:Label id="L1" runat="server" Text='<%# Eval("productName") %>'></asp:Label><br /> Price: <asp:Label

ASP.NET Repeater bind List<string>

半城伤御伤魂 提交于 2019-11-27 18:26:11
I am binding a List<string> to a Repeater control. Now I want to use the Eval function to display the contents in ItemTemplate like <%# Eval("NAME") %>. But I am not sure what I should use instead of NAME. Vadim Just use <%# Container.DataItem.ToString() %> If you are worried about null values you may want to refactor to this (.NET 6+) <asp:Repeater ID="repeater" runat="server"> <ItemTemplate> <%# Container.DataItem?.ToString() ?? string.Empty%> </ItemTemplate> </asp:Repeater> Note if you are using less than .NET 6 you cannot use the null-conditional operator Container.DataItem?.ToString() Set

Binding a generic list to a repeater - ASP.NET

空扰寡人 提交于 2019-11-27 18:21:19
I am trying to bind a List<AreaField> to a repeater. I have converted the list into an array by using the ToArray() method and now have a array of AreaField[] Here's my class hierarchy public class AreaFields { public List<Fields> Fields { set; get; } } public class Fields { public string Name { set; get; } public string Value {set; get; } } In the aspx, I would like to bind it a repeater (something like this) DataBinder.Eval(Container.DataItem, "MyAreaFieldName1") The MyAreaFieldName1 is the value of the Name property in the AreaFieldItem class. bendewey You may want to create a subRepeater.