Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2005, 02:30 AM
Authorized User
 
Join Date: Feb 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kumarop
Default Page name through asp code

Hello

     Can I get asp page name on runtime through asp code directly ,or can I write some code on page so that I can get page name on runtime??

2) How to refer path above the root like we can refer down folder like root\folder1\test.asp (at the time of include).If you can write an example stating absolute and relative path in this context it will be very helpful.





Regards



om prakash kumar
__________________
om prakash kumar
 
Old April 7th, 2005, 03:14 AM
Authorized User
 
Join Date: Mar 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can retrive the relative and absolute path of an asp page, at any point in your code, from the server variables.

'this returns the relative path
strRelativePath = Request.ServerVariables("PATH_INFO")
'You can then map this into the physical path
strPhysicalPath = Server.MapPath(strRelativePath)

From there you can manipulate the path info for use with the FileSystemObject.

Hope this helps.

 
Old April 7th, 2005, 05:50 AM
Authorized User
 
Join Date: Feb 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kumarop
Default

Quote:
quote:Originally posted by orbbital
 You can retrive the relative and absolute path of an asp page, at any point in your code, from the server variables.

'this returns the relative path
strRelativePath = Request.ServerVariables("PATH_INFO")
'You can then map this into the physical path
strPhysicalPath = Server.MapPath(strRelativePath)

From there you can manipulate the path info for use with the FileSystemObject.
Hope this helps.



<%

 strRelativePath =Request.ServerVariables("PATH_INFO")returns -/webeis/sms.asp


strPhysicalPath = Server.MapPath(strRelativePath)returns -D:\iffcoindia\webeis\sms.asp


code useed-



error message-

Active Server Pages error 'ASP 0126'

Include file not found

/webeis/sms.asp, line 17

The include file 'd:\iffcoindia\function_webeis.asp' was not found.




om prakash kumar
 
Old April 8th, 2005, 12:29 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii kumarop!!!
when i run mypage.asp it will give following information


strRelativePath =Request.ServerVariables("PATH_TRANSLATED")
 //D:\Report\common\mypage.asp
strAppPhyPath =Request.ServerVariables("APPL_PHYSICAL_PATH")
// D:\Report\common\

Hope this will help you

Cheers :)

vinod
 
Old May 1st, 2005, 01:43 PM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sFile below contains the file name without folders or other path data...

Dim strRelativePath As String = Request.ServerVariables("PATH_TRANSLATED").ToLower

Dim strAppPhyPath As String = Request.ServerVariables("APPL_PHYSICAL_PATH").ToLo wer

Dim sFile As String = Right(strRelativePath, Len(strRelativePath) - Len(strAppPhyPath))








Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Page Method: Code-Behind for Content Page kwilliams ASP.NET 2.0 Professional 3 June 2nd, 2008 12:57 PM
access C#.Net page as action of calssic ASP page mansharma_s ASP.NET 1.x and 2.0 Application Design 6 January 7th, 2008 10:58 AM
How to pass the variables in Aspx page to Asp Page jayaraj ASP.NET 1.0 and 1.1 Basics 3 May 23rd, 2004 06:55 AM
passing values from ASP page to a popup ASP Page astrosmurfboy Classic ASP Basics 3 April 21st, 2004 08:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.