The root of your problem seems to be that you never initialize the _IncomingURL member, unless you explicitly set it. I think you're on the wrong track here. Make a constructor instead which reads out the Url property and remove the Set accessor.
Another problem is that your IncomingURL class inherits from Page. While it isn't really a Page. But I assume that you've done so because otherwise you could not reach the Request object, am I right? The good news is that you can actually access the Request object - without being inside a Page. You do this by using the HttpContext object.
Also the naming of your class is somewhat strange. Typically you should refrain from using the term "Class" in your class name. So a more appropriate name would be "IncomingUrl". But that's just a recommendation - and it's not what's causing the problem.
Finally, it's a bit misleading that your class suggests that it handles the Url when you actually return the host part of the Url. Therefore, I think you should make one property to return the Url and one for the Host. Here's my suggested implementation:
Imports Microsoft.VisualBasic
Public Class IncomingUrl
Private _IncomingURL As String
Public Sub New(ByVal value As Integer)
_IncomingURL = HttpContext.Request.Url
End Sub
Public Property URL() As String
Get
Return _IncomingURL.ToString()
End Get
End Property
Public Property Host() As String
Get
Return _IncomingURL.Host
End Get
End Property
End Class
Actually, after having rewritten the code, I realize this entire class is totally redundant. You'll do much better if you access HttpContext.Request.Url.Host directly
If this post was useful to you, please mark it as answer. Thank you!