yavsc/SalesCatalog/Model/SelectInput.cs

30 lines
574 B
C#
Raw Normal View History

2014-07-16 20:35:03 +02:00
using System;
using System.Text;
using System.Web.Mvc;
namespace SalesCatalog.Model
{
public class SelectInput: FormInput
{
#region implemented abstract members of FormInput
public override string Type {
get {
return "select";
}
}
#endregion
2014-07-16 20:35:03 +02:00
public Option[] Items;
public int SelectedIndex;
public override string ToHtml ()
{
StringBuilder sb = new StringBuilder ();
foreach (Option opt in Items)
sb.Append (opt.ToHtml());
return string.Format ("<select id=\"{0}\" name=\"{1}\">{2}</select>\n", Id,Name,sb.ToString());
}
}
}