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. Geting MapPath in Customer Server Control

Geting MapPath in Customer Server Control

Scheduled Pinned Locked Moved ASP.NET
sysadminsaleshelpquestion
3 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.
  • N Offline
    N Offline
    Nadia Monalisa
    wrote on last edited by
    #1

    Hello, Would you please do me a favour by asnwering this question please... In my customer Server Control (Composite Control), I have a File Upload component which has an Event handler of Click. within the Click Event Handler, I wanted to save the uploaded file to a given path. I wanted to use MapPath() method but I dont get any reference working for this method. I know it works when we have ASPX page and this mehtod is a member of Page Class. But I could not get any workaround to get the useful path information from the virutal path in the Customer Server Control. Can you please help me. Regards Bashiwala.

    S 1 Reply Last reply
    0
    • N Nadia Monalisa

      Hello, Would you please do me a favour by asnwering this question please... In my customer Server Control (Composite Control), I have a File Upload component which has an Event handler of Click. within the Click Event Handler, I wanted to save the uploaded file to a given path. I wanted to use MapPath() method but I dont get any reference working for this method. I know it works when we have ASPX page and this mehtod is a member of Page Class. But I could not get any workaround to get the useful path information from the virutal path in the Customer Server Control. Can you please help me. Regards Bashiwala.

      S Offline
      S Offline
      Saifi Hasan
      wrote on last edited by
      #2

      In you custom control you can not get direcr ref to SERVER object, User HttpContext.Current.Server.MapPath()

      Nobody is perfect i'm Nobody

      N 1 Reply Last reply
      0
      • S Saifi Hasan

        In you custom control you can not get direcr ref to SERVER object, User HttpContext.Current.Server.MapPath()

        Nobody is perfect i'm Nobody

        N Offline
        N Offline
        Nadia Monalisa
        wrote on last edited by
        #3

        Dear saifigr8 Thanks a lot, thats what the snippet I was searching for. you helped me a lot in this way. Regards Bashiwala

        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