I think maybe you couldn’t pass a variable to get the value. Because the “GetCurrentMethod” is a shared function in “System.Reflection.MethodBase”, you couldn’t use it by an instance of class “System.Reflection.MethodBase”. You could first get the value
and then pass a string to the “SendError.Manage()”.
Member
9 Points
53 Posts
Passing Web Page reference to back end....
Jul 24, 2015 12:42 PM|GADOI2|LINK
Hello:
I am working on a generic errorhandler.
In the page where the error occurred, I would like to pass a reference to either the page or the class where the error occurred....
something like:
Try
trigger error....
catch
Dim SendError As New MyErrorHandling
SendError.Manage(Me)
end catch
where "Me" reference the area where the error occurred.
Then in the backend class....
Public Class MyErrorHandling
Public Function Manage(ByRef stuff As ????) As String
In here, I would like to get the equivalent to System.Reflection.MethodBase.GetCurrentMethod.Name
end function
So, if not Me what should I pass and then what is received.... sender as ... what...
Thanks
Star
7970 Points
1586 Posts
Re: Passing Web Page reference to back end....
Jul 26, 2015 11:32 PM|Weibo Zhang|LINK
Hi GADOI2,
I think maybe you couldn’t pass a variable to get the value. Because the “GetCurrentMethod” is a shared function in “System.Reflection.MethodBase”, you couldn’t use it by an instance of class “System.Reflection.MethodBase”. You could first get the value and then pass a string to the “SendError.Manage()”.
http://stackoverflow.com/questions/613998/what-is-the-use-of-shared-variable-in-vb-net
https://msdn.microsoft.com/en-us/library/system.reflection.methodbase.getcurrentmethod(v=vs.110).aspx
I hope it’s useful to you.
Best Regards,
Weibo Zhang