asp.net C#。。。的错误
刚学c#,谁帮调试下,纠正下。。先谢啦。。
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class ListPicker : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void SourceList_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void AddAll_Click(object sender, EventArgs e)
{
TargetList.SelectedIndex = -1;
foreach(ListItem li in SourceList.Items)
{ AddItem(li); }
}
protected void AddOne_Click(object sender, EventArgs e)
{
if (SourceList.SelectedIndex >= 0)
AddItem(SourceList.SelectedItem);
}
protected void Remove_Click(object sender, EventArgs e)
{
if (TargetList.SelectedIndex >= 0)
{
TargetList.Items.RemoveAt(TargetList.SelectedIndex);
TargetList.SelectedIndex = -1;
}
}
protected void AddItem(ListItem li)
{
TargetList.SelectedIndex = -1;
TargetList.Items.Add(li);
}
public ListItemCollection SelectedItems
{
get { return TargetList.Items; }
}
public Boolean AllowDuplicates
{
get
{
return (Boolean)ViewState["allowDuplicates"];
}
set
{
ViewState["allowDuplicates"] = value;
}
}
}
public void AddSourceItem(String sourceItem)
{
SourceList.Items.Add(sourceItem);
}
public void ClearAll()
{
SourceList.Items.Clear();
TargetList.Items.Clear();
}
protected void AddItem(ListItem li)
{
TargetList.SelectedIndex = -1;
if (this.AllowDuplicates == true)
TargetList.Items.Add(li);
else
{
if (TargetList.Items.FindByText(li.Text) == null)
{
TargetList.Items.Add(li);
}
}
}
错误 1 应输入 class、delegate、enum、interface 或 struct
错误 2 应输入 class、delegate、enum、interface 或 struct
错误 3 应输入 class、delegate、enum、interface 或 struct
上面那错误什么情况发生呢?????