/ Published in: VB.NET
Usage of Server, Response and Request object with HttpContext declaration from external class
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Imports system.Web Public Class log Shared Sub PrintQueryString() ' usage: lib.PrintQueryString() Dim Server As Web.HttpServerUtility = Web.HttpContext.Current.Server Dim Response As Web.HttpResponse = Web.HttpContext.Current.Response Dim Request As Web.HttpRequest = Web.HttpContext.Current.Request Dim QueryString As System.Collections.Specialized.NameValueCollection = Request.QueryString Dim Param As String For Each Param In QueryString Response.write("param name: " & Param ) Response.write("<br>") Response.write("param value: " & QueryString(Param) ) Response.write("<br>") Next end Sub end Class
URL: http://maurizio.mavida.com/2007/01/12/usare-httpcontext-fuori-da-una-pagina-aspx/