0
我嘗試創建一個具有點擊evet的asp.net列表框。 要做到這一點,我創建了一個項目,創建一個dll文件,我將其添加到我的工作箱在Visual Studio 2008中。 它不起作用! 這裏是創建DLL文件中的代碼:使用單擊雙擊事件創建asp.net列表框
namespace list_box
{
public class list_box : ListBox, IButtonControl
{
private bool blCausesValidation = true;
private string strCommandArgument = "";
private string strCommandName = "";
private string strPostBackUrl = "";
private string strText = "";
private string strValidationGroup = "";
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.CssClass = "frmbtn";
}
bool IButtonControl.CausesValidation
{
get
{
return blCausesValidation;
}
set
{
blCausesValidation = value;
}
}
string IButtonControl.CommandArgument
{
get
{
return strCommandArgument;
}
set
{
strCommandArgument = value;
}
}
string IButtonControl.CommandName
{
get
{
return strCommandName;
}
set
{
strCommandName = value;
}
}
string IButtonControl.PostBackUrl
{
get
{
return strPostBackUrl;
}
set
{
strPostBackUrl = value;
}
}
string IButtonControl.Text
{
get
{
return strText;
}
set
{
strText = value;
}
}
string IButtonControl.ValidationGroup
{
get
{
return strValidationGroup;
}
set
{
strValidationGroup = value;
}
}
public event EventHandler Click;
void click_i(object sender, EventArgs e)
{
OnClick(new EventArgs());
}
protected virtual void OnClick(EventArgs e)
{
if (Click != null)
{
click_i(this, e);
}
}
public event CommandEventHandler Command;
void Command_i(object sender, CommandEventArgs e)
{
OnCommand(new CommandEventArgs(e));
}
protected virtual void OnCommand(CommandEventArgs e)
{
if (Command != null)
{
Command_i(this, e);
}
}
}
}
幫我!!!! 我在asp.net所以新....