Last post Jan 26, 2017 01:44 PM by Gleeming
Jan 26, 2017 01:54 AM|Gleeming|LINK
I have an asp.net web project and the main solution is named Teams. The Teams solution has a project named Soccer. The Soccer project has two different folders. The first
one is named RedTeam, and the second one is named BlueTeam. Each folder has web forms with their C# code behind files. Now I have a web form in the RedTeam folder named redSoccerTeam.aspx. In redSoccerTeam.aspx.cs I am opening a web form as a popup window.
Another web form named blueSoccerTeam.aspx is serving as a popup window
and it is called from my redSoccerTeam.aspx.cs file. The issue I am having is that since blueSoccerTeam.aspx is in the BlueTeam folder, I am not able to reference it because I
can't figure out how to reference it in my showModalDialog method below. Please see the code below.
// In C# file which is in the RedTeam folder
Note, I have tried referencing the path to blueSoccer.aspx in various ways as shown below but none of these paths are working:
Jan 26, 2017 03:05 AM|oned_gk|LINK
AFAIK, you can't referent to another project or parent project.
But, you can use .. to go to parent level
from red project you can referent http://domain/red/ using "~/", but you can't use "~/.."
I have not test it yet, but maybe like this
string redroot = ResolveClientUrl("~/");
string blueurl = redroot + "/../blue";
Jan 26, 2017 05:23 AM|Gleeming|LINK
THanks. It still does not work. It is looking for the resource in the Red Soccer Team folder .
Jan 26, 2017 12:48 PM|markfitzme|LINK
Use the ../ notation to go up a directory. Use it several times to go further up the path, then walk down the path again. This is 100% possible, but not knowing the actual paths from the root URL make it difficult for us to tell you exactly how to do it.
Remember though, on the web the path uses / for directories. \\ is for physical file paths on the server and doesn't do anything when linking in html.
Jan 26, 2017 01:44 PM|Gleeming|LINK
Thanks "../BlueTeam//BlueSoccerTeam.aspx" is the correct reference