repeater

Bind Directory.EnumerateFiles to a Repeater using a Generic List

自作多情 提交于 2019-12-11 10:59:07
问题 I am trying to create a small web app, that when I type in a game name, it will search through a folder with a whole lot of icons to find one similar to the typed in game. I then want to show a repeater with the name of the icon, as well as the icon next to it. So far I have successfully displayed the name with this code: IEnumerable<string> getfiles = from f in Directory.EnumerateFiles(Server.MapPath("~/_resources/game_icon"), "*.*", SearchOption.AllDirectories) where Path.GetFileName(f)

How to get updated Textbox value from Repeater?

丶灬走出姿态 提交于 2019-12-11 10:17:06
问题 I have a repeater control as listed below. It has a textbox control. When a save button is clicked, I need to get the updated text from the textbox. I have the following code; but it gives me the old value when I take the textbox text. How can we get the updated text? Code Behind protected void Save_Click(object sender, EventArgs e) { foreach (RepeaterItem item in repReports.Items ) { if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem ) { string

Accessing a nested repeater's datasource

谁说胖子不能爱 提交于 2019-12-11 10:13:48
问题 I have a repeater: <asp:Repeater ID="rptSessions" runat="server"> Inside this I have another repeater: <asp:Repeater ID="rptPeople" runat="server" OnItemDataBound="rptPeople_ItemDataBound"> On the ItemDataBound on my parent repeater, I am setting the datasource for the child repeater. Dim dtPeople As New DataTable dtPeople.Columns.Add("FirstName") dtPeople.Columns.Add("LastName") dtPeople.Columns.Add("Company") If e.Item.DataItem("Lunch") = True Then dtPeople.Columns.Add("Dietary") <-- ***

Buttons and repeater control

心已入冬 提交于 2019-12-11 10:08:49
问题 I am using ASP.NET, C#, Sql Server 2005 for my project and I'm using the repeater control to form a table of users that are a member of a site and a button next to each user so that they can be added to your friends list. I have everything set up except I dont know how to get the specific info of each row after a button click. I mean, How to send a friend request to a person whose username is displayed besides the button? or How to access the the displayed username besides the button so that

how to use asp repeater with nested bulletedlist programatically

守給你的承諾、 提交于 2019-12-11 09:55:44
问题 I'm new to using repeaters in vb and I'm trying to understand how to it with a nested bulletedlist programatically. I have the code that generates my data within a System.Web.UI.WebControls.TreeView object and I'm trying to put it into a nested bulletedlist list. I have the following vb and asp code: TreeView.aspx <asp:Repeater ID="repeater" runat="server" EnableViewState="False" OnItemDataBound="repeater_ItemDataBound"> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate> <li> <asp

Repeater ItemCommand Doesn't fire

久未见 提交于 2019-12-11 09:48:47
问题 What I want I want to fire ItemCommand event when some one click on repeater. Issue The ItemCommand is not fired. Code FrontEnd Code <asp:Repeater ID="rptthumbnail" AutoCallback="true" runat="server" Visible="true"> <ItemTemplate> <td style="height:81px;width:51px"> <asp:ImageButton ID="imgThumbnail" style="height:80px;width:50px" runat="server" /> </td> </ItemTemplate> </asp:Repeater> Page_Load Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If

Display particular word on some condition Eval Asp.net

故事扮演 提交于 2019-12-11 09:27:13
问题 <asp:Label ID="lblLeaveStatus" runat="server" Font-Bold="true" Text='<%# Eval("Leave_Status").ToString() == 'A' ? 'Approved' : 'Applied' %>'></asp:Label> Condition to display a particular word in the GridView on some condition Could some thing like this work on Gridview I get an error Server Tag not well formed 回答1: Try this <asp:Label ID="lblLeaveStatus" runat="server" Font-Bold="true" Text='<%# Eval("Leave_Status").ToString() .Equals ( "A") ? "Approved" : "Applied" %>'></asp:Label> 回答2: Use

How can I ensure a service is started at 9am and stopped 9pm every day?

亡梦爱人 提交于 2019-12-11 09:13:30
问题 I have a service that will monitor location changes daily. What I know so far that to start a service at boot, I have to follow the linked tutorial. This way I can get the service started at boot, but to save battery I need it only between 9am-9pm. Question is pretty simple, so I will repeat: How can I ensure a service is started at 9am and stopped 9pm every day? 回答1: Use AlarmManager to set two alarms, each with a PendingIntent that will call startService() on your service, but with distinct

Cannot Find Label Control In Repeater Control

冷暖自知 提交于 2019-12-11 08:57:51
问题 I want to take the Label control with ID TextLabel in the code behind, but this give me the following exception Object reference not set to an instance of an object. The exception is on this line of code in code behind file: Label label = e.Item.FindControl("TextLabel") as Label; string text = label.Text; What mistake I made here ? How to find "TextLabel" control in code behind ? aspx code: <asp:Repeater ID="UserPostRepeater" runat="server" OnItemDataBound="UserPostRepeater_ItemDataBound">

ASP.net Repeater — setting N Maximum Repetitions?

拟墨画扇 提交于 2019-12-11 08:56:07
问题 I am using a Repeater control to display data from a SQL server on multiple different sites right now. I am wondering if there is any way to make a repeater only "repeat" or run through its cycles a maximum of N times. I split a Div element up into 4 equal sections which have just enough room for 4 cycles of this repeater. If it runs more than 4 times, it pushes everything down in the div and begins a new row of images/text I would prefer to avoid. It makes the web page look uglier and does