Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > How to Define Default Event?

Reply
Thread Tools

How to Define Default Event?

 
 
Stephen Barrett
Guest
Posts: n/a
 
      02-10-2004
We have a couple of webcontrols that we have built for our web development.
All these controls basically listen to a single event handler. The controls
are currently loaded into our toolbox for drag and drop addition.

I have noticed that on the controls from MSFT, if you double click it in
design view, it wires up the event handler in the OnInit and takes you to
code view.

I would like to add this functionality to our controls to save developer
time doing it manually by switching to "event" view on the property page of
the control and manually typing in the EventHandler property.

Can someone point me in the right direction or let me know how to do this?

TIA,
Stephen


 
Reply With Quote
 
 
 
 
Alessandro Zifiglio
Guest
Posts: n/a
 
      02-11-2004
hi Steven,
You must expose this event to the client from within your control. In the
public event handler, your custom control exposes, mark it as you would with
any property you want exposed in the propertygrid. The events go in the
action category like :

[
Category("Action"),
Description("Raised when MySomeButton click occurs.")
]
public event SomebuttoEventHandler MyButtonCommand {
add {
Events.AddHandler(EventMyButtonCommand, value);
}
remove {
Events.RemoveHandler(EventMyButtonCommand, value);
}
}

"Stephen Barrett" <stephen_barrett@aoncons_nospam.com> wrote in message
news:%(E-Mail Removed)...
> We have a couple of webcontrols that we have built for our web

development.
> All these controls basically listen to a single event handler. The

controls
> are currently loaded into our toolbox for drag and drop addition.
>
> I have noticed that on the controls from MSFT, if you double click it in
> design view, it wires up the event handler in the OnInit and takes you to
> code view.
>
> I would like to add this functionality to our controls to save developer
> time doing it manually by switching to "event" view on the property page

of
> the control and manually typing in the EventHandler property.
>
> Can someone point me in the right direction or let me know how to do this?
>
> TIA,
> Stephen
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
About typedef -- define the function pointer or define function model? robin liu C Programming 3 04-21-2006 03:26 PM
#define _ and #define __ Brian Takita Ruby 0 01-23-2006 04:34 AM
How to define a define that defines some defines ? theotyflos C Programming 3 02-19-2004 05:07 PM
Mozilla's email program unable to define default font Victor Firefox 15 10-09-2003 09:20 PM



Advertisments