ASP.NET virtual path problem.

  • Thread starter Thread starter KK
  • Start date Start date
K

KK

Hi,

I have done my ASP.NET applications authentication like in
Duwamish example. My directory structure is like below

APPROOT (IIS virtual path = TRACK)
default.aspx <-- contains the logon procedures
web.config
SECURED <secured directory>
web.config
mainframe.htm
<OTHER DIRs & FILES>

2 problems I have.

1) If some body types a url on the browser and say,
go to "mainframe.htm" directly, It redirects
him back to the default.aspx. which is the correct
behaviour. But because mainframe.htm is a frameset
default.aspx page is shown in every frame. UGLY.

how can i fix this?

2) If in a normal case, user directly goes to default.aspx.
After authentication;

FormsAuthentication.RedirectFromLoginPage("*",false);
goes back to the default.aspx, which is ok
because in the default.aspx on Page_Load() i do a

* Try to retreieve logged session data
* if no session data show msg, stay on the page
* if its there , redirect him to mainframe.htm

now problem happense when redirecting to mainframe.htm
using Server.Transfer("secured/mainframe.htm")
because after transfering mainframe looks for its pages
in APPROOT (virtual dir TRACK) not in SECURED
directory(where the files are)

but if I disable this authentication and just go to mainframe.htm
it works fine.

Upon authentication how can I set the app root path to
TRACK/SECURED ? If Ican do this, it shoudl work I guess

Any hints?

regards
KK
 
Tryusing a root-relative path (e.g. "/secured/mainframe.htm) Root-relative
paths always begin from the root folder of the web.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top