Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head runat="server">
- <meta charset="utf-8" />
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <select>
- <option value="1">M³/min</option>
- <option value="2">M³/s</option>
- </select>
- <asp:DropDownList ID="drp" runat="server"></asp:DropDownList>
- </div>
- </form>
- </body>
- </html>
- public partial class MyPage: System.Web.UI.Page
- {
- private class idAndUnit
- {
- public int Id { get; set; }
- public string Unit { get; set; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- var units = new List<idAndUnit>()
- {
- new idAndUnit
- {
- Id = 1,
- Unit = "M³/min"
- },
- new idAndUnit
- {
- Id = 2,
- Unit = "M³/min"
- }
- };
- drp.DataSource = units;
- drp.DataTextField = "Unit";
- drp.DataValueField = "Id";
- drp.DataBind();
- }
- }
- <select>
- <option value="1">M³/min</option>
- <option value="2">M³/s</option>
- </select>
- <select name="drp" id="drp">
- <option value="1">M³/min</option>
- <option value="2">M³/min</option>
Add Comment
Please, Sign In to add comment