Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Using Request and the Tracing method in a function

Using Request and the Tracing method in a function

Scheduled Pinned Locked Moved ASP.NET
debuggingtutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jaimecavazos
    wrote on last edited by
    #1

    I'm using page tracing method and instead of writing it over and over, I wanted to write a function in a .cs page and just call the function from my other pages. Here is my code: public void pageTracing() { if (Request["trace"] == "trace") { Trace.isEnabled = true; } } It's giving me these errors: The name 'Request' does not exist in the class or namespace 'web_isotope.functions.clsFunctions' The type or namespace name 'Trace' could not be found (are you missing a using directive or an assembly reference?) If you please could, give me an example of the correct way to do this, I'm just beginning, thanks in advance!

    M 1 Reply Last reply
    0
    • J jaimecavazos

      I'm using page tracing method and instead of writing it over and over, I wanted to write a function in a .cs page and just call the function from my other pages. Here is my code: public void pageTracing() { if (Request["trace"] == "trace") { Trace.isEnabled = true; } } It's giving me these errors: The name 'Request' does not exist in the class or namespace 'web_isotope.functions.clsFunctions' The type or namespace name 'Trace' could not be found (are you missing a using directive or an assembly reference?) If you please could, give me an example of the correct way to do this, I'm just beginning, thanks in advance!

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      Request is member of HttpContext class and its part of System.Web namespace which is not added to your class . For playing with that in your class you have to use HttpContext.Current roperty and pass it to a HttpContext vatiable and use that for Trace or Request. Mazy You're face to face, With the man who sold the world - David Bowie

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups