Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CustomDropDown.ascx.cs" Inherits="Mirabeau.CustomCmsDataTypes.UserControlls.CustomDropDown" %>
- <asp:DropDownList id="drop1" runat="server">
- <asp:ListItem>Item 1</asp:ListItem>
- <asp:ListItem>Item 2</asp:ListItem>
- <asp:ListItem>Item 3</asp:ListItem>
- <asp:ListItem>Item 4</asp:ListItem>
- <asp:ListItem>Item 5</asp:ListItem>
- <asp:ListItem>Item 6</asp:ListItem>
- </asp:DropDownList>
- <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
- <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
- --------------
- using System;
- namespace Mirabeau.CustomCmsDataTypes.UserControlls
- {
- public partial class CustomDropDown : System.Web.UI.UserControl, umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor
- {
- public object value
- {
- get
- {
- return drop1.SelectedValue;
- }
- set
- {
- drop1.SelectedValue = value.ToString();
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Page.IsPostBack)
- {
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- string dropDownValue = string.Empty;
- dropDownValue = value.ToString();
- Label1.Text = "You have selected this" + dropDownValue;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement