Wow, three posts in one night. I've been busy tonight.
I saw a post on ASP.Net asking for an example of how to access the Request, Response, Server, Session and Application Objects in a .Net class. The answer is to use the HttpContext in you class. I thought I would post a quick example here.
Imports System.Web
Public Class MyClass
Public Shared Sub MyFunction()
Dim ctx As HttpContext = HttpContext.Current
Dim strMyVar1 As String = ctx.Request("MyVar1")
Dim strMyVar2 As String = ctx.Request("MyVar2")
End Class
It's as simple as that.
Comments