Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Abraham Andres Luna #1
IButtonControl.Click
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.
Abraham Andres Luna Guest
-
double click causes click-event anddoubleClick-event
I too am interested in a response to this. I see all kinds of information on how to enable the double-click event, but not how to distinguish... -
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl.
Hello I have the following situation: (everything is dynamic (controls.add)) 1. Button.Init { WasButtonClickFired = true } 2.... -
Click / Double Click
Am I doing something wrong? Wrong coding? Wrong handler? I am rying to get the button to fire on clicking..... it WILL work on "double click"... any... -
Single click vs double click in mouseDown and mouseUp
For a double click mouseDown and mouseUp catch 2 event: the first report clickCount value 1 and the second report value 2. How to respond to a... -
Datalist selects Item after first click, but does apply the SelectedItemTemplate after the second click only
Background: On my webform a simple datalist shows one column. The databind is done in the page_load event. In the ItemTemplate a linkbutton serves... -
Teemu Keiski #2
Re: IButtonControl.Click
Hi,
Button base class already implements IButtonControl, so you shouldn't need
to reimplement the interface. Wth your ISBaseButton you could use:
<form id="form1" runat="server" defaultbutton="Button1" >
....
<cc:ISBaseButton ID="Button1" runat="server" />
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
[url]http://blogs.aspadvice.com/joteke[/url]
"Abraham Andres Luna" <brag1518@hotmail.com> wrote in message
news:eg7LO$$BHHA.996@TK2MSFTNGP02.phx.gbl...> 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.
>
>
Teemu Keiski Guest



Reply With Quote

