R
rn5a
Is putting a VB class file in the special directory named App_Code the
same as relocating the VB class file from the App_Code directory to
another directory & then using the VBC tool, compiling the VB class
file into a DLL & putting the DLL in the bin directory?
Though while running an ASP.NET app using either of the 2 approaches
doesn't make any difference, Visual Web Developer 2005 Express Edition
behaves erratically sometimes if the VB class file resides in the
App_Code directory & the corresponding DLL doesn't exist in the bin
directory.
I have a user control named MyUC.ascx. This file only contains the UI
elements (like TextBoxes, Labels etc.) & the entire logic resides in a
code behind named MyUC.ascx.vb which exists in the App_Code directory.
I register the user control in an ASPX page named MyPage.aspx (which
resides outside the App_Code directory) with the following Register
directive
<%@ Register TagPrefix="UC" TagName="UCtrl" Src="MyUC.ascx" %>
& add the following lines after the Register directive:
<script runat="server">
Public UC1 As MyUC_ascx
Public UC2 As MyUC_ascx
Sub Page_Load(....)
'some code
End Sub
</script>
Now when the mouse is hovered over any of the 2 lines which declare the
2 variables UC1 & UC2 (the 2 "Public" lines) in VWD, then VWD says
Type 'MyUC_ascx' is not declared.
But if I relocate the code behind MyUC.ascx.vb to some directory other
than the App_Code directory & then compile MyUC.ascx.vb into a DLL in
the bin directory using VBC, then VWD no longer reflects the error when
the mouse is moved over the 2 lines which declare UC1 & UC2.
Is this some sort of bug in VWD or does the CLR behave differently when
a VB class file resides in the App_Code directory (& no corresponding
DLL exists in the bin directory) and when the VB class does not reside
in the App_Code directory & the VB class file is compiled into a DLL in
the bin directory?
same as relocating the VB class file from the App_Code directory to
another directory & then using the VBC tool, compiling the VB class
file into a DLL & putting the DLL in the bin directory?
Though while running an ASP.NET app using either of the 2 approaches
doesn't make any difference, Visual Web Developer 2005 Express Edition
behaves erratically sometimes if the VB class file resides in the
App_Code directory & the corresponding DLL doesn't exist in the bin
directory.
I have a user control named MyUC.ascx. This file only contains the UI
elements (like TextBoxes, Labels etc.) & the entire logic resides in a
code behind named MyUC.ascx.vb which exists in the App_Code directory.
I register the user control in an ASPX page named MyPage.aspx (which
resides outside the App_Code directory) with the following Register
directive
<%@ Register TagPrefix="UC" TagName="UCtrl" Src="MyUC.ascx" %>
& add the following lines after the Register directive:
<script runat="server">
Public UC1 As MyUC_ascx
Public UC2 As MyUC_ascx
Sub Page_Load(....)
'some code
End Sub
</script>
Now when the mouse is hovered over any of the 2 lines which declare the
2 variables UC1 & UC2 (the 2 "Public" lines) in VWD, then VWD says
Type 'MyUC_ascx' is not declared.
But if I relocate the code behind MyUC.ascx.vb to some directory other
than the App_Code directory & then compile MyUC.ascx.vb into a DLL in
the bin directory using VBC, then VWD no longer reflects the error when
the mouse is moved over the 2 lines which declare UC1 & UC2.
Is this some sort of bug in VWD or does the CLR behave differently when
a VB class file resides in the App_Code directory (& no corresponding
DLL exists in the bin directory) and when the VB class does not reside
in the App_Code directory & the VB class file is compiled into a DLL in
the bin directory?