CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > starter_kits_and_source_projects.portal_starter_kit Tags:
Item Type: Date Entered: 11/12/2003 3:34:14 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 2 Views: 38 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
"dgilmour78" <>
NewsGroup User
Path issue11/12/2003 3:34:14 AM

0

I have have just downloaded the IBuySpy Portal and installed it (The version for web matrix).
I for the life of me can not get it to display more that the first page. It seems to be a path issue as the links all seem to lose the localhost bit. Any clues as to how I can fix this would be greatfully accepted as it is driving me crazy

Thank you :-)
"dgilmour78" <>
NewsGroup User
Re: Path issue *Unresolved*11/17/2003 4:38:44 AM

0

I still haven't found a solution to this. Basically most of the links on my first page
are 'http:\\DesktopDefault.aspx?.....' instead of 'http:\\DesktopDefault.aspx?.....'
I have looked though the source have haven't found anything. I haven't modified the source.
I have wondered if it was anything to do with the webserver behind webmatrix but other sample apps work fine. Installing IIS isn't an option *unfortunately*

Can anyone suggest anything to try next?

Thank you :-)
"big richard" <
NewsGroup User
Re: Path issue *Unresolved*11/17/2003 11:14:48 PM

0

I got this from http://aspsmith.com/DesktopDefault.aspx?tabindex=2&tabid=32.

Another thing you can do is replace all the <%= Application("AppPath")%> calls with the correct relative path.

ie. If you have a hyperlink that reads <%= Application("AppPath")%>/portal.css you could get there by using ../portal.css from one of the inner folders etc.

Those hyperlinks that are resolving different tabs for the Desktop Default don't really need the <%= Application("AppPath")%> portion. You can just trim those to DesktopDefault.aspx?tabindex=1, 2, 3, etc.

This problem is happening because if you deploy to a root web you are not in a virtual directory. Try doing a response.write(Application("AppPath")) and see what you get.
You will probably get a null string. This is what you need to fix.

BUG FIX: When I deploy to a root web, how do I get my links to work correctly (Request.ApplicationPath doesn't work)?

A: Answer from Brock on aspngibuyspy list at ASPFriends.com:


I apologize for the last post, it wasn't quite tested very well. This is a
new solution. I might be able to clean it up more with a little more
research, but this works for both virtual directories and root sites. The
If statement checks on every request, but the code should only process once.

I put this code in the Application_BeginRequest:

' Build the Application Path
If Application("AppPath") = Nothing Then
Dim sAbsUri As String = Request.Url.AbsoluteUri
Dim sRawUrl As String = Request.RawUrl

If Request.ApplicationPath = "/" Then
Application("AppPath") = Left(sAbsUri, Len(sAbsUri) - Len(sRawUrl))
Else
Application("AppPath") = Left(sAbsUri, Len(sAbsUri) - Len(sRawUrl)) &
Request.ApplicationPath
End If
End If

Then just replace all the script calls for
with <%= Application("AppPath")%>


--------------------------------------------------------------------------------
Another solution (C#):

I wrote a piece of C# code yesterday following the same strategy which was
in VB on your site to fix this issue and it works fine.

In Global.ascx:

protected void Application_BeginRequest(Object sender, EventArgs e)
{
....
// Build the Application Path to workaround Web root reference issue
if (Application["AppPath"] == null)
{
String sAbsUri = Request.Url.AbsoluteUri;
String sRawUrl = Request.RawUrl;

if (Request.ApplicationPath == "/")
Application["AppPath"]= sAbsUri.Substring(0,sAbsUri.Length -
sRawUrl.Length);
else
Application["AppPath"] = sAbsUri.Substring(0,sAbsUri.Length -
sRawUrl.Length) + Request.ApplicationPath;

}
......

}

Then replace all "Request.Applicationpath" in *.aspx and *.ascx with
Application["AppPath"]
replece all "~/..." in *.cs with Application["AppPath"] +"/..."

For example:

Replace redirect("~/admin/tablayout.aspx) with
redirect(Application["AppPath"]+"/admin/tablayout.aspx)

It works for both root web and virtual directory.

Jerome Xie
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:













bug : system.nullreferenceexception: object reference not set to an instance of an object.

windows 2003

anyone interested in building a portal using the new .net 2.0 framework?

installing ibuyspy - need help

annoying problem with syles

newbie question - rss

ibuyspy portal with oracle db

bc30456: 'getarchivedannouncements' is not a member of 'aspnetportal.announcementsdb'

how do add a control dynamically if i have the moduleid?

how to add menu with submenus and be able to asign security roles to them

ibuyspy forum

problem is the installation[select one instance of sql server]

can i get some different looking tabs?

milestone db missing

master pages

windows nt user or group 'myserver\aspnet' not found.

no lock icon in browser with ssl on portal

compiling the ibuyspy.dll in access version

cookie exceeds 4kb

moving an active asp.net portal website.

how run sql scripts manually

problem logging in

default page problems on cssdk portal

custom page under a tab.

admin tab not accessible

how do i connect ibuyspy portal with ms access database

[email protected]?

stored procedure

discussions and the new window

application_beginrequest performance impact

portal not multiuser capable!?

documents module with date control

getting the username from within a control

portalcfg.xml -> msde database

integration between ibyspy portal and store

new module

retrieve email of user logged in

portal starter kit web.config, portalcfg.xml and portalcpg.xsd

problem copying online

post back problem

contacts email addresses hyperlinked

remote installation, configuration

help me out in portal starter kit 1.1

'specified cast not valid' in desktopdefault.aspx.vb

login failed for user 'nt authority\network service

portal starter kit (bug-fixed version)

moving portal to isp

ibs vs. dnn vs. rp vs. psk

problems with windows server 2003

instantiating module class within desktopdefault.aspx.cs

   
  Privacy | Contact Us
All Times Are GMT