
Untitled
By: a guest on
Aug 22nd, 2012 | syntax:
C# | size: 1.05 KB | hits: 11 | expires: Never
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using Logic;
using System.Data;
using System.Data.Entity;
namespace UserControl
{
public class UC2 : System.Web.UI.WebControls.WebControl
{
Label label = new Label();
public string Etiqueta
{
get { return label.Text; }
set { label.Text = value; }
}
DropDownList ddl = new DropDownList();
public string ValorSeleccionado
{
get { return ddl.SelectedValue;}
}
protected override void OnInit(EventArgs e)
{
label.ID = this.ID + "_lbl";
this.Controls.Add(label);
Logica ddlLogic = new Logica();
ddl.ID = this.ID + "_ddl";
ddl.DataSource = ddlLogic.cargar();
ddl.DataTextField = "RegionDescription";
ddl.DataBind();
this.Controls.Add(ddl);
base.OnInit(e);
}
}
}