Accessing Server.MapPath from within Custom Controls Render() method?

Discussion in 'ASP .Net Web Controls' started by Kenneth Baltrinic, Oct 16, 2003.

  1. I am writing a simple custom control to read in an rtf file, convert it to
    HTML and output the HTML. I ran into one little glitch. My control has a
    FileName property, the value of which I want to convert from a relative path
    to get the actual file path on the server. I need MapPath for this but I
    don't have access to an HTTPServerUtility object (the class of object
    returned by Page.Server) inside the Render method. Any suggestions?

    --Ken Baltrinic
     
    Kenneth Baltrinic, Oct 16, 2003
    #1
    1. Advertising

  2. Kenneth Baltrinic

    IgorW Guest

    Try this(Me in VB.NET).Page.Request....
    HttpRequest.FilePath
    or HttpRequest.Path
    or HttpRequest.PhysicalPath




    Am Wed, 15 Oct 2003 20:50:05 -0400 hat Kenneth Baltrinic
    <> geschrieben:

    > I am writing a simple custom control to read in an rtf file, convert it
    > to
    > HTML and output the HTML. I ran into one little glitch. My control has
    > a
    > FileName property, the value of which I want to convert from a relative
    > path
    > to get the actual file path on the server. I need MapPath for this but I
    > don't have access to an HTTPServerUtility object (the class of object
    > returned by Page.Server) inside the Render method. Any suggestions?
    >
    > --Ken Baltrinic
    >
    >
     
    IgorW, Oct 16, 2003
    #2
    1. Advertising

  3. Kenneth Baltrinic

    Rajesh.V Guest

    Use a custom designer class,and override the function
    GetDesignTimeHtml() method.

    The link for the same is

    http://msdn.microsoft.com/library/d...n-us/cpguide/html/cpconhtmldesignersample.asp

    "Kenneth Baltrinic" <> wrote in message
    news:%...
    > I am writing a simple custom control to read in an rtf file, convert it to
    > HTML and output the HTML. I ran into one little glitch. My control has a
    > FileName property, the value of which I want to convert from a relative

    path
    > to get the actual file path on the server. I need MapPath for this but I
    > don't have access to an HTTPServerUtility object (the class of object
    > returned by Page.Server) inside the Render method. Any suggestions?
    >
    > --Ken Baltrinic
    >
    >
     
    Rajesh.V, Oct 16, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dHBhcmtzNjk=?=

    server.mappath vs. request.mappath

    =?Utf-8?B?dHBhcmtzNjk=?=, Mar 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,179
    Juan T. Llibre
    Mar 11, 2007
  2. Replies:
    4
    Views:
    994
    Juan T. Llibre
    Oct 7, 2007
  3. Demetri

    Controls within Custom Control Don't Render

    Demetri, Dec 5, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    148
    Mark Fitzpatrick
    Dec 5, 2003
  4. PA

    Accessing Server.Mappath from SoapExtension

    PA, May 19, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    138
    Dino Chiesa [Microsoft]
    May 19, 2004
  5. Glenn Gillen
    Replies:
    0
    Views:
    288
    Glenn Gillen
    Nov 17, 2006
Loading...

Share This Page