Posted By

miziomon on 01/12/07


Tagged

VBNet aspnet HttpContext


Versions (?)

HttpContext in external class


 / Published in: VB.NET
 

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

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

  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

Report this snippet  

You need to login to post a comment.