I’m developing a web application that has a Login page. In that page’s code behind page, I’m calling a function from another class called “MyOtherClass”. That class uses the “Sub New(blah)” method/procedure to connect it all. Basic version of code shown below.
It works, however, here’s my issue:
As I’m developing, I like to launch the site, make changes to the code, and then hit the browser refresh to see the changes. However, for some reason, changes I make to “MyOtherClass” don’t show. I either have to:
- Go to IIS express in the Windows system tray and stop the site or exit the service.
- Rebuild the project from the Visual Studio “Build > Rebuild” menu.
- Or, if neither of those work, completely close VS and start everything up again.
Any ideas?
It has to do with my usage of the “Sub New(blah)” method on “MyOtherClass” because this never happened before I just started using this (and need to).
I’m developing in VB.NET in Visual Studio Community 2017. It launches IIS express when I browse the site.
Code for the Login.aspx.vb file.
Partial Class login
Inherits System.Web.UI.Page
Public vOtherClass As New MyOtherClass(Me)
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If vOtherClass.VerifyMe() = True Then
Response.Write("Yes! You made it!")
Else
Response.Write("Dang it! Try again!")
End If
End Sub
End Class
Code for the MyOtherClass.vb file.
Public Class MyOtherClass
Dim vPAGEOBJECT As Page
Sub New(MyPage As Page)
vPAGEOBJECT = MyPage
End Sub
Function VerifyMe() As Boolean
'If I change this to return 'False' while I'm browsing my design, VS won't reflect the change.
Return True
End Function
End Class