标题:asp.net C#。。。的错误
取消只看楼主
ping燕s
Rank: 2
来 自:江西
等 级:论坛游民
帖 子:40
专家分:33
注 册:2009-9-22
结帖率:71.43%
已结贴  问题点数:30 回复次数:0 
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
 
上面那错误什么情况发生呢?????


   
搜索更多相关主题的帖子: asp 
2010-04-19 16:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-303618-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.045747 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved