Abraham Andres Luna
11/14/2006 3:16:00 PM
hello everyone,
i am trying to set the defaultbutton property and i get the following error:
The DefaultButton of '' must be the ID of a control of type IButtonControl.
so i guess instead of this class declaration:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace IS.WebControls
{
public class ISBaseButton : Button
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.CssClass = "frmbtn";
}
}
}
i need this one:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace IS.WebControls
{
public class ISBaseButton : WebControl, IButtonControl,
IPostBackEventHandler
{
private bool blCausesValidation = false;
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 void IButtonControl.Click(Object Sender, EventHandler E)
{
//
}
}
}
so that the defaultbutton property can work. i need help in declaring the
IButtonControl.Click and the IButtonControl.Command event. everything i have
tried fails, and i've searched the internet for examples and have found
nothing that works.
so far i've tried:
EventHandler IButtonControl.Click(Object Sender, EventArgs E)
{
//
}
and many others.
thanks for your help.