repeater

Why is the ASP.NET Repeater.Items collection empty, when controls are on the screen?

冷暖自知 提交于 2020-01-05 04:39:21
问题 I have an ASP page with the following repeater: <asp:Repeater runat="server" ID="RegionRepeater" DataSourceID="SqlDataSourceRegions" EnableViewState="true"> <ItemTemplate> <tr> <td valign="top"> <b><%#Eval("description")%></b> <asp:HiddenField runat="server" ID="RegionID" Value='<%#Eval("region_id")%>'/> </td> <td> <asp:FileUpload ID="FileUpload" runat="server" Width="368px" /> </td> </tr> </ItemTemplate> </asp:Repeater> (The repeater is inside a Wizard, inside a content pane). The code

how to use DataBinder.Eval of repeater within asp.net button's OnClientClick javascript

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-03 03:46:11
问题 I have a repeater in my asp.net webform. In "ItemTemplate" of the repater i added a asp:button. And i write the following code on "OnClientClick" event of the button. //This is javascript function function DeleteGroup(groupID){ return confirm('Do you want to delete ' + groupID); //This is asp.net page code<br> <asp:Button runat="server" ID="btnDelete" Text="Delete" OnClientClick=" return DeleteGroup(<%# DataBinder.Eval(Container.DataItem, "GrupID") %>); " /> I have tried many variant of

ASP.NET C#, dynamic drop down in repeater causing full post back

旧时模样 提交于 2020-01-03 02:26:12
问题 I have a page that contains a Repeater, which contains server control elements, within an UpdatePanel and while all other controls behave normally, the Drop Down control causes a full postback every time. <asp:Repeater ID="rpt" runat="server"> <ItemTemplate> <asp:SomeWorkingControl ID="swc" runat="server" /> <asp:DropDownList ID="ddl" runat="server" OnSelectedIndexChanged="ddl_SelectedIndexChanged" AutoPostBack="true"> <asp:ListItem Text="0" Value="0" /> <asp:ListItem Text="1" Value="1" /> <

Dynamic dropdownlist in repeater, ASP.NET

≯℡__Kan透↙ 提交于 2020-01-02 07:35:48
问题 Basically, the codes I have is from here : http://ranafaisal.wordpress.com/2009/02/17/dynamically-adding-removing-textboxes-in-aspnet-repeater/ However, the thing is that, I will need a dropdownlist with textboxes. The purpose of having dropdownlist is to allow users to select their country of origin. They have the option to Add or Remove the particulars they have entered before. This is my error message: 'ddlName' has a SelectedValue which is invalid because it does not exist in the list of

How to nest repeaters in asp.net

回眸只為那壹抹淺笑 提交于 2020-01-02 02:42:10
问题 I need to know how to nest repeaters within a user control. The html side of things is fine, it's the binding and code behind I need help with. I've only been able to find examples using an sql data source, which doesn't really help. My repeaters look like this: <asp:Panel ID="pnlDiscipline" runat="server" CssClass=""> <asp:Repeater ID="rptDiscipline" runat="server"> <ItemTemplate> <h4><%#Eval("Discipline")%></h4> <ul> <asp:Repeater ID="rptPrograms" runat="server"> <ItemTemplate> <li><asp

Update Panel and triggers from a repeater control

☆樱花仙子☆ 提交于 2020-01-01 09:38:56
问题 Hi I found code similiar to the following online. It's seems really great for getting a button buried in a repeater control to trigger a full cycle back to the server. <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <%=DateTime.Now.ToString() %> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="HiddenButton" /> </Triggers> </asp:UpdatePanel> <!--Make a hidden button to treat as the

ASP.NET Repeater Template, Conditional Code for every Nth element

十年热恋 提交于 2020-01-01 04:19:35
问题 I'm using an asp.net repeater to create a bunch of images. The image markup is all the same so the standard <ItemTemplate> is fine. However, I want to wrap K images in a div. Lets say I bind 25+ images to the repeater and I want 5 images per div. How do I go about conditionally creating the start and close tags for the div? Is this a case better suited for a for loop. 回答1: This should work for you, with no need for anything in the code behind (other than binding the repeater..): <asp:Repeater

MVC .Net create model and related models at same time

早过忘川 提交于 2019-12-31 07:26:07
问题 I have a model called Company and company can have 1 or more directors. I want to be able to create any number of directors at the same time as creating a company. I made the Create view of the of the Director a partial view: @using (Ajax.BeginForm("Create", "Director", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "partial", InsertionMode = InsertionMode.InsertAfter })) { @Html.EditorFor(model => model.Title) ... } On the Create view of the Company I have a button which loads the

I want to call images from database in to ASP:repeater control but I am getting <image src“System.Byte[]”> in result

旧城冷巷雨未停 提交于 2019-12-31 03:16:07
问题 This is my code in aspx file cnn.Open(); SqlDataAdapter da1 = new SqlDataAdapter("select * from carousel", cnn); DataTable dt1 = new DataTable(); da1.Fill(dt1); Rp1.DataSource = dt1; Rp1.DataBind(); cnn.Close(); and this is repeater <asp:Repeater id="Rp1" runat="server"> <ItemTemplate> <div class="item"> <asp:Image ID="Image1" ImageUrl='<%# Eval("image") %>' runat="server" /> </div> </ItemTemplate> <footertemplate></footertemplate> </asp:Repeater> I tried everything but I am getting in result

how to show image in the column of repeater control in asp.net?

拜拜、爱过 提交于 2019-12-31 03:05:16
问题 I'm using repeater control from asp.net for data binding. And for designing i used the div & span for data representation. I have 4 fields to my table & i want to show the images on the each span depending on the field value. Images are stored in my project path itself. How to do this? 回答1: Use this <asp:Repeater ID="RepeaterImages" runat="server"> <ItemTemplate> <img src='<%#GetImage(Databinder.Eval(Container.DataItem, "ImageID"))%>' alt="" width="" height="" /> </ItemTemplate> </asp