User control declaration event

xiaoxiao2021-03-06  67

Expose An Event from your User Control

A.ASCX:

Public Event athandler myevent;

In Your Control's Event Handler, Do

IF (MyEvent! = NULL)

Myevent (sender, evenetargs.empty);

// The syntax for vb.net is raiseevent

.

IN your aspx page:

In somehandler, you can do anything you want

You might need to consider to use a custom delegate and Eventargs, See

Http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondefiningcustoment.asp

转载请注明原文地址:https://www.9cbs.com/read-91707.html

New Post(0)