Click here to Skip to main content
15,909,440 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Kind of out of place since theis is not an ASP.NET question, but it's ASP & VB script related Pin
RoswellNX26-Sep-06 8:21
RoswellNX26-Sep-06 8:21 
GeneralRe: Kind of out of place since theis is not an ASP.NET question, but it's ASP & VB script related Pin
Guffa26-Sep-06 8:59
Guffa26-Sep-06 8:59 
GeneralRe: Kind of out of place since theis is not an ASP.NET question, but it's ASP & VB script related Pin
RoswellNX26-Sep-06 9:17
RoswellNX26-Sep-06 9:17 
AnswerRe: Kind of out of place since theis is not an ASP.NET question, but it's ASP & VB script related Pin
Guffa26-Sep-06 9:51
Guffa26-Sep-06 9:51 
GeneralRe: Kind of out of place since theis is not an ASP.NET question, but it's ASP & VB script related Pin
RoswellNX26-Sep-06 10:09
RoswellNX26-Sep-06 10:09 
AnswerRe: Kind of out of place since theis is not an ASP.NET question, but it's ASP & VB script related Pin
Guffa26-Sep-06 11:24
Guffa26-Sep-06 11:24 
NewsWorks! Pin
RoswellNX26-Sep-06 10:38
RoswellNX26-Sep-06 10:38 
QuestionEvent Handling Pin
jorsh26-Sep-06 7:06
jorsh26-Sep-06 7:06 
Aside from dealing with UI events (such as OnClick for Buttons) and getting at DataItems in bound controls (such as OnItemDataBound for Repeaters), I'm having a difficult time understanding why one would implement event handlers.

I've spent the last few hours searching Google and the articles and forums in this site, and while I've found plenty of great resources on HOW to implement custom event handlers, I haven't found any that explain WHY I would want to.

For example, one article (in Visual Studio's Help) gave an example of an AlarmClock. The AlarmClock would raise an Alarm event and a listener for that event would execute some code. Why is this model better than simply calling a Ring() method of the AlarmClock class?

Why would this:
protected virtual void OnAlarm(AlarmEventArgs e)<br />
{<br />
    AlarmEventHandler handler = Alarm; <br />
    if (handler != null) <br />
    { <br />
        // Invokes the delegates. <br />
        handler(this, e); <br />
    }<br />
}

be better than this:
protected void Ring()<br />
{<br />
    // do what the delegates would have done.<br />
}


Any answers (including links to articles) would be very appreciated.

Thanks,
Jorsh
AnswerRe: Event Handling Pin
minhpc_bk26-Sep-06 15:40
minhpc_bk26-Sep-06 15:40 
QuestionAsp.Net 2.0 RSS. Need advice. Pin
shapper26-Sep-06 5:33
shapper26-Sep-06 5:33 
AnswerRe: Asp.Net 2.0 RSS. Need advice. Pin
minhpc_bk26-Sep-06 15:41
minhpc_bk26-Sep-06 15:41 
Question.NET2 Dispay data from SQL2005 Pin
munklefish26-Sep-06 5:09
munklefish26-Sep-06 5:09 
AnswerRe: .NET2 Dispay data from SQL2005 Pin
Dayekh26-Sep-06 5:19
Dayekh26-Sep-06 5:19 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish26-Sep-06 5:23
munklefish26-Sep-06 5:23 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
Dayekh26-Sep-06 5:38
Dayekh26-Sep-06 5:38 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish26-Sep-06 5:42
munklefish26-Sep-06 5:42 
AnswerRe: .NET2 Dispay data from SQL2005 Pin
Keith Barrow26-Sep-06 6:25
professionalKeith Barrow26-Sep-06 6:25 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish26-Sep-06 6:34
munklefish26-Sep-06 6:34 
AnswerRe: .NET2 Dispay data from SQL2005 Pin
minhpc_bk26-Sep-06 16:10
minhpc_bk26-Sep-06 16:10 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish27-Sep-06 5:41
munklefish27-Sep-06 5:41 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
minhpc_bk27-Sep-06 15:37
minhpc_bk27-Sep-06 15:37 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish27-Sep-06 22:33
munklefish27-Sep-06 22:33 
AnswerTHE SOLUTION Pin
munklefish27-Sep-06 23:47
munklefish27-Sep-06 23:47 
QuestionDataGrid Display Pin
Dayekh26-Sep-06 5:03
Dayekh26-Sep-06 5:03 
AnswerRe: DataGrid Display Pin
sanju027626-Sep-06 5:20
sanju027626-Sep-06 5:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.