We Recommend

Beginning VB.NET Beginning VB.NET
Visual Basic .NET is the latest version of the most widely used programming language in the world, popular with professional developers and complete beginners alike. This book will teach you Visual Basic .NET from first principles. You'll quickly and easily learn how to write Visual Basic .NET code and create attractive windows and forms for the users of your applications.


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.