|
Subject:
|
RecordDeletedEvent and Event code
|
|
Posted By:
|
Tuppers
|
Post Date:
|
10/2/2006 5:10:02 AM
|
hi guys been looking at this fantastic book but i am having trouble with a couple of small bits. i was wondering if anyone could help me?
Firstly there is some code in the book on page 109 there is a some code for RecordDeletedEvent i cannot find this anywhere in the code files supplied? i am wanting to take this and recompile it in my own app but i dont want to use a dll yet i am just testing my code. So i was wondering where i would place that code???
Also when using the following code <add name="TBH Events" eventName="TBH Events" provider="..." profile="Critical" /> i was wondering what does this actually do? does it use the compiled code in the dll? why is it there? can you just simply change the name? and events name?
Cheers and thanks in advance
Tuppers
|
|
Reply By:
|
Tuppers
|
Reply Date:
|
10/2/2006 4:14:11 PM
|
hi guys figured out the first problem i created a new customevents.vb file with the following in:
Imports System.Web Imports System.Web.Management
Namespace MB.TheBeerHouse Public MustInherit Class WebCustomEvent Inherits WebBaseEvent
Public Sub New(ByVal message As String, ByVal eventSource As Object, ByVal eventCode As Integer) MyBase.New(message, eventSource, eventCode) End Sub End Class
Public Class RecordDeletedEvent Inherits WebCustomEvent
Shadows Const eventCode As Integer = WebEventCodes.WebExtendedBase + 10 Shadows Const message As String = _ "The {0} with ID = {1} was deleted by user {2}."
Public Sub New(ByVal entity As String, ByVal id As Integer, _ ByVal eventSource As Object) MyBase.New(String.Format(message, entity, id, _ HttpContext.Current.User.Identity.Name), eventSource, eventCode) End Sub End Class End Namespace
so that sorts the first peoblem. My second problem with the TBH Events in the web.config file within the healthmoitoring where is this referenced too? cant find anything on it in the solution?
Cheers Tupps
|