M
Mythran
I upgraded a VB.Net 1.1 project to 2.0b2 and now I can't seem to figure out
how to fix my user controls. I have a user control named SecurityControl
that contains a few static methods and properties (as well as instance
methods and properties). Now that I've upgraded the project to 2.0b2, my
User Controls can't be accessed from the new App_Code files (my code files
from before the upgrade). I've tried to do the same thing with a new web
application project, but still no luck. How can I write the following from
within a "Module" that is under App_Code?
App_Code\Common.vb:
Public Function SomeTestMethod() As Boolean
' Some validation or something here...
' Check security.
Return SecurityControl.IsInRole("MyRoleName")
End Function
In SecurityControl.ascx.vb:
Public Shared Function IsInRole(ByVal Role As String) As Boolean
' Do some error checking before the following call.
Return Thread.CurrentPrincipal.IsInRole(Role)
End Function
Thanks in advance,
Mythran
how to fix my user controls. I have a user control named SecurityControl
that contains a few static methods and properties (as well as instance
methods and properties). Now that I've upgraded the project to 2.0b2, my
User Controls can't be accessed from the new App_Code files (my code files
from before the upgrade). I've tried to do the same thing with a new web
application project, but still no luck. How can I write the following from
within a "Module" that is under App_Code?
App_Code\Common.vb:
Public Function SomeTestMethod() As Boolean
' Some validation or something here...
' Check security.
Return SecurityControl.IsInRole("MyRoleName")
End Function
In SecurityControl.ascx.vb:
Public Shared Function IsInRole(ByVal Role As String) As Boolean
' Do some error checking before the following call.
Return Thread.CurrentPrincipal.IsInRole(Role)
End Function
Thanks in advance,
Mythran