Request.ApplicationPath problem

Discussion in 'ASP.NET / ASP.NET Core' started by jspurlin, Oct 5, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Request.ApplicationPath is working on my local host machine, but when I upload the application to the server it no longer works.

    I am using the design of the ASPNET.PORTAL and in order for the tabs to work, for example, I have to replace Requestion.ApplicationPath with my domain 'http://netsolutionxp.com':

    ASPNET.PORTAL HTML/ASPX
    <a href='<%= Request.ApplicationPath %>/DesktopDefault.aspx?tabindex=<%# Container.ItemIndex %>&tabid=<%# ((TabStripDetails) Container.DataItem).TabId %>' class="OtherTabs"><%# ((TabStripDetails) Container.DataItem).TabName %></a>

    WHAT I HAVE TO DO:
    <a href='http://NetsolutionsXP.com/DesktopDefault.aspx?tabindex=<%# Container.ItemIndex %>&tabid=<%# ((TabStripDetails) Container.DataItem).TabId %>' class="OtherTabs"><%# ((TabStripDetails) Container.DataItem).TabName %></a>

    I am looking for the solution that will work both on localhost and when I upload the application to DiscountAsp.

    Any help would be appreciated. Thank you.
    John Spurlin
     
  2. Server.MapPath("DesktopDefault.aspx?.....")
     
  3. I'm not understanding this thread.


    Are you saying you can't use Request.ApplicationPath?


    Everything's working on my site except the images in sub folders and the pages that are in subfolders which are called from code.


    I've tried the following and none of them work.


    MyBase.HeaderIconImageUrl = Server.MapPath + "/images/securekeys.gif"


    MyBase.HeaderIconImageUrl = Request.ApplicationPath + "/images/securekeys.gif"


    MyBase.HeaderIconImageUrl = "/images/securekeys.gif"



    MyBase.HeaderIconImageUrl = "/images/securekeys.gif"


    It works on localhost of course.


    I also have the same problem if I'm calling a page in a sub folder with Context.Request.ApplicationPath


    The site works fine if I publish it to a subfolder under the main site. I'm new and haven't figured out how to call just the default page on my website and then reroute it to the login page automatically.
    That would solve my problem with the subfolders.


    Never mind, everyone. I ended up moving the site to the subfolder, and[​IMG][​IMG] created a Default page that immediately takes the user to the default page of the folder I wanted. Now all of my images and pages work.


    Thanks, Bruce, for all you contribute!


    Penny


    Post Edited (Penny) : 11/5/2004 3:27:45 AM GMT
     
  4. This works.



    protected string GetPath()


    {


    sPath = this.Context.Request.Url.Scheme + "://" + this.Context.Request.Url.Authority;


    return sPath;


    }
     
  5. Off course in .net 2.0 there are better ways to handles this.

    Ray Akkanson
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page