HttpContext in external class


/ Published in: VB.NET
Save to your folder(s)

Usage of Server, Response and Request object with HttpContext declaration from external class


Copy this code and paste it in your HTML
  1. Imports system.Web
  2. Public Class log
  3. Shared Sub PrintQueryString()
  4. ' usage: lib.PrintQueryString()
  5. Dim Server As Web.HttpServerUtility = Web.HttpContext.Current.Server
  6. Dim Response As Web.HttpResponse = Web.HttpContext.Current.Response
  7. Dim Request As Web.HttpRequest = Web.HttpContext.Current.Request
  8. Dim QueryString As System.Collections.Specialized.NameValueCollection = Request.QueryString
  9. Dim Param As String
  10. For Each Param In QueryString
  11. Response.write("param name: " & Param )
  12. Response.write("<br>")
  13. Response.write("param value: " & QueryString(Param) )
  14. Response.write("<br>")
  15. Next
  16. end Sub
  17. end Class

URL: http://maurizio.mavida.com/2007/01/12/usare-httpcontext-fuori-da-una-pagina-aspx/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.