repeater


Dynamically add row to GridView / DataGrid / Repeater?

半城伤御伤魂 提交于 2020-01-15 11:43:22
问题 I want to create a "table" that the user will complete which has an unknown number of rows. To illustrate it, let's say it is to enter details from a receipt after a shopping trip - i.e. the number of rows (or items) will be unknown. To acheive this I want to create a grid with a single row, and two columns containing textboxes to enter the item name and price: +-------+---------+ + Item + Price + +-------+---------+ + Beans + 0.99 + +-------+---------+ Then after the first row has been

Dynamically add row to GridView / DataGrid / Repeater?

二次信任 提交于 2020-01-15 11:39:56
问题 I want to create a "table" that the user will complete which has an unknown number of rows. To illustrate it, let's say it is to enter details from a receipt after a shopping trip - i.e. the number of rows (or items) will be unknown. To acheive this I want to create a grid with a single row, and two columns containing textboxes to enter the item name and price: +-------+---------+ + Item + Price + +-------+---------+ + Beans + 0.99 + +-------+---------+ Then after the first row has been

<script>…</script> inside a repeater control code not showing up in the source code on page render

假如想象 提交于 2020-01-15 03:51:28
问题 I have a repeater control where the <%#DataBinder.Eval(Container.DataItem, "Display")%> part doesn't show up. The code that the "Display" stores is set as follows: item.Display = "<script type='text/javascript'> AudioPlayer.embed('ffcedea7-4822-465f-85b6-89924f7b81fa', {soundFile: 'http://s3.amazonaws.com/blah/af8g7fd3-1793-4b5e-92b7-9d11ad1cc19c.mp3'}); </script>"; After the page load, the audio embed file doesn't show up. The code doesn't even show up in the source. If I add a random string

Binding a Generic List of type struct to a Repeater

六眼飞鱼酱① 提交于 2020-01-14 08:00:32
问题 I've had a bit of a problem trying to bind a generic list to a repeater. The type used in the generic list is actually a struct. I've built a basic example below: struct Fruit { public string FruitName; public string Price; // string for simplicity. } protected void Page_Load(object sender, EventArgs e) { List<Fruit> FruitList = new List<Fruit>(); // create an apple and orange Fruit struct and add to List<Fruit>. Fruit apple = new Fruit(); apple.FruitName = "Apple"; apple.Price = "3.99";

Create a Repeater control in ASP.Net

喜欢而已 提交于 2020-01-11 12:06:39
问题 I'm using two drop down and bind values to that drop down. Now am adding a new button add_new. I want to create the above drop downs below when I click the add button and maintain the previous selected values. Please help me to do this. 回答1: You can achieve the desired result using Repeater control of ASP.Net. You can create any type of template as you wish, see the code below: ASPX: <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server

Create a Repeater control in ASP.Net

南楼画角 提交于 2020-01-11 12:03:21
问题 I'm using two drop down and bind values to that drop down. Now am adding a new button add_new. I want to create the above drop downs below when I click the add button and maintain the previous selected values. Please help me to do this. 回答1: You can achieve the desired result using Repeater control of ASP.Net. You can create any type of template as you wish, see the code below: ASPX: <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server

Use .Net-Repeater with jquery

混江龙づ霸主 提交于 2020-01-11 06:53:05
问题 I have a Repeater (ASP.Net). <asp:Repeater ID="rep" runat="server"> <ItemTemplate> <asp:TextBox runat="server" ID="txt"></asp:TextBox> <asp:CheckBox runat="server" ID="cb" /> </ItemTemplate> I would like to write Text in the text-box if I click on the checkbox, using jQuery. Is this possible and how. 回答1: I'd recommend simply using a CSS class and using that to identify the TextBox: <asp:Repeater ID="rep" runat="server"> <ItemTemplate> <asp:TextBox runat="server" ID="txt"></asp:TextBox> <asp

User Control Inside Repeater

耗尽温柔 提交于 2020-01-10 08:55:25
问题 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=

User Control Inside Repeater

时光怂恿深爱的人放手 提交于 2020-01-10 08:54:14
问题 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=

C# Repeater with a Varying Number of Rows Each Able to Return a Different String With a CheckBox/Other Method

青春壹個敷衍的年華 提交于 2020-01-07 06:39:40
问题 The Asp.net website I am creating uses a Repeater to display a list of Strings concerning duplicates or missing entries from two databases. There is another list of strings created in parallel of SQL statements with one SQL statement corresponding to the same numbered string in the Repeater list. The number of strings in the lists depends on the databases chosen and can range from zero to 100+. Question: Since the number of Repeater rows are unknown, I am trying to find some method to

工具导航Map