Re: VB.Net 2.0 b2 + Web UserControl
- From: Brock Allen <ballen@xxxxxxxxxxxxxxxxx>
- Date: Wed, 08 Jun 2005 17:12:28 -0700
If the code in the .vb file in App_Code is in a class definition, then it should all be ok -- ASP.NET will compile the .vb file for you and the resultant assembly should be accessible from all of your pages.
-Brock DevelopMentor http://staff.develop.com/ballen
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
.
- Follow-Ups:
- Re: VB.Net 2.0 b2 + Web UserControl
- From: Mythran
- Re: VB.Net 2.0 b2 + Web UserControl
- References:
- VB.Net 2.0 b2 + Web UserControl
- From: Mythran
- VB.Net 2.0 b2 + Web UserControl
- Prev by Date: Re: About Application_Error
- Next by Date: Re: Timeout period not seeming to work correctly
- Previous by thread: VB.Net 2.0 b2 + Web UserControl
- Next by thread: Re: VB.Net 2.0 b2 + Web UserControl
- Index(es):
Relevant Pages
|