c# - Add a new property to an ASP.NET dropdownlist -
i need add new property asp.net dropdownlist called scoretitle. accepts 4 values , need intellisense show 4 values (e.g value1, value2,value3, , value4).
public class scoredropdownlist : dropdownlist { private string _scoretitle; public string scoretitle { { return _scoretitle; } set { _scoretitle = value; } } public scoredropdownlist() : base() { (int = 0; <= 10; i++) { items.add(new listitem(i.tostring())); } } } markup:
<mobile:scoredropdownlist id="ddltidiness" scoretitle="value1" runat="server" cssclass="input-mini inline" /> how can add scoretitle property , make 4 values appear when setting the scoretitle?
make score title enum type.
public enum scoretitle { none, win, loss, deuce } then
public scoretitle scoretitle { get; set; }
Comments
Post a Comment