Click here to Skip to main content
15,893,487 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: ReportViewer Help Pin
pmarfleet27-Feb-08 7:28
pmarfleet27-Feb-08 7:28 
GeneralRe: ReportViewer Help Pin
Aptiva Dave27-Feb-08 7:36
Aptiva Dave27-Feb-08 7:36 
Generalcountdown timer Pin
eyeseetee27-Feb-08 3:30
eyeseetee27-Feb-08 3:30 
GeneralRe: countdown timer Pin
Not Active27-Feb-08 3:37
mentorNot Active27-Feb-08 3:37 
GeneralRe: countdown timer Pin
eyeseetee27-Feb-08 3:55
eyeseetee27-Feb-08 3:55 
GeneralRe: countdown timer Pin
J4amieC27-Feb-08 4:22
J4amieC27-Feb-08 4:22 
GeneralRe: countdown timer Pin
Not Active27-Feb-08 4:23
mentorNot Active27-Feb-08 4:23 
GeneralEvent handling in VB.NET Pin
Mark75127-Feb-08 3:19
Mark75127-Feb-08 3:19 
Hi, I read another thread on this topic, but it didn't seem to help me. What I'm trying to do is raise an event (that handles an exception) on a page if an exception is thrown on a class that it calls. My code is below:



** default.aspx **

Partial Public Class _Default
Inherits System.Web.UI.Page

Private WithEvents clsGenerateForm As SAF.GenerateForm.GenerateForm

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub

Private Sub Wizard1_NextButtonClick(ByVal s As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.NextButtonClick

If Wizard1.ActiveStepIndex = 1 Then

If RadioButton1.Checked Then

Wizard1.ActiveStepIndex = 2

Else

Wizard1.ActiveStepIndex = 3

End If

End If

End Sub


Sub HandleError() Handles clsGenerateForm.peHandleDatabaseException

pnlWiz.Visible = False

pnlError.Visible = True

End Sub


Protected Sub lbtnTest_Click(ByVal sender As Object, ByVal e As EventArgs) Handles lbtnTest.Click

Dim clsGenerateForm As New SAF.GenerateForm.GenerateForm()

pnlWiz.Visible = False

pnlComplete.Visible = True

End Sub



** extract from the GenerateForm class **

Namespace SAF.GenerateForm

Public Class GenerateForm
Inherits SAF.Abstract.DBAbstract


Private Sub CreateNewForm()

Dim cmd As SqlCommand

Dim dtr As SqlDataReader

cmd = New SqlCommand("SAF_Form_Create", connSql)

cmd.CommandType = CommandType.StoredProcedure

Try

connSql.Open()

dtr = cmd.ExecuteReader

dtr.Read()

_formID = dtr("FormID")

Catch ex As Exception

ExceptionThrown(ex.ToString)

Finally

If connSql.State = ConnectionState.Open Then

connSql.Close()

End If

End Try

End Sub


Sub New()

CreateNewForm()

End Sub



End Class

End Namespace



** SAF.Abstract.DBAbstract class **

Namespace SAF.Abstract

Public MustInherit Class DBAbstract

Public Event peHandleDatabaseException()

Protected connSql As SqlConnection = New SqlConnection(PUBLIC_MSSQL_CONNSTRING)

Protected Sub ExceptionThrown(ByVal strException As String)

Dim clsErrorLog As New SAF.ErrorLog.ErrorLog(strException)

Dim clsErrorEmail As New SAF.Email.ErrorEmail(strException)

RaiseEvent peHandleDatabaseException()

End Sub

End Class

End Namespace





The problem I'm having is that, while the event on the abstract class is being raised, it is not triggering it's handler on default.aspx.

If anyone is able to help, I'd appreciate it as I've been tearing my hair out for days now!
Generalasp.net timer Pin
eyeseetee27-Feb-08 2:29
eyeseetee27-Feb-08 2:29 
GeneralRe: asp.net timer Pin
Not Active27-Feb-08 2:43
mentorNot Active27-Feb-08 2:43 
GeneralRe: asp.net timer Pin
eyeseetee27-Feb-08 2:53
eyeseetee27-Feb-08 2:53 
GeneralRe: asp.net timer Pin
Not Active27-Feb-08 3:08
mentorNot Active27-Feb-08 3:08 
QuestionProblem with Ajax's AutoCompleteExtender [modified] Pin
dews turner27-Feb-08 2:28
dews turner27-Feb-08 2:28 
QuestionTransferring Between Databases Using Web Service? Pin
cbjroms27-Feb-08 2:18
cbjroms27-Feb-08 2:18 
GeneralRe: Transferring Between Databases Using Web Service? Pin
Christian Graus27-Feb-08 10:26
protectorChristian Graus27-Feb-08 10:26 
GeneralRe: Transferring Between Databases Using Web Service? Pin
Not Active27-Feb-08 11:30
mentorNot Active27-Feb-08 11:30 
GeneralRe: Transferring Between Databases Using Web Service? Pin
Expert Coming27-Feb-08 15:05
Expert Coming27-Feb-08 15:05 
QuestionHow can I clear the history of a browser page by using scripts or programming Pin
G Nathan27-Feb-08 1:50
G Nathan27-Feb-08 1:50 
GeneralRe: How can I clear the history of a browser page by using scripts or programming Pin
Sam Xavier2-Mar-08 23:03
Sam Xavier2-Mar-08 23:03 
QuestionHow to read image data from xml file Pin
Krishnraj27-Feb-08 1:36
Krishnraj27-Feb-08 1:36 
GeneralRe: How to read image data from xml file Pin
Christian Graus27-Feb-08 9:05
protectorChristian Graus27-Feb-08 9:05 
QuestionHi friends. what should i use instead of ""window.location.replace(URL)""? [modified] Pin
G Nathan27-Feb-08 1:29
G Nathan27-Feb-08 1:29 
GeneralRe: Hi friends. what should i use instead of ""window.location.replace(URL)""? Pin
J a a n s27-Feb-08 1:41
professionalJ a a n s27-Feb-08 1:41 
GeneralAJAX Pin
.NET- India 27-Feb-08 1:27
.NET- India 27-Feb-08 1:27 
GeneralRe: AJAX Pin
J a a n s27-Feb-08 1:42
professionalJ a a n s27-Feb-08 1:42 

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.