473,549 Members | 2,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting the page name

How do I request the actual page name that I'm on? This is going to go into
an include file, and depending on which page I'm on, I'd like to do
different things. I'm looking for "pagename.a sp"
Jul 19 '05 #1
15 2111
Exract it from the SCRIPT_NAME server variable.

<%

Response.Write GetFilename

Function GetFilename
Dim sPath, aParts
sPath = Request.ServerV ariables("SCRIP T_NAME")
aParts = Split("/" & sPath, "/")
GetFilename = aParts(UBound(a Parts))
End Function
%>

Ray at work

"middletree " <mi********@hto mail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
How do I request the actual page name that I'm on? This is going to go into an include file, and depending on which page I'm on, I'd like to do
different things. I'm looking for "pagename.a sp"

Jul 19 '05 #2
strPageName = Request.ServerV ariables("SCRIP T_NAME") & "<br>"
if instr(strPageNa me,"/")>0 then
strPageName = right(strPageNa me, len(strPageName ) -
instrRev(strPag eName,"/"))
end if
response.write strPageName

Cheers
Steve
"middletree " <mi********@hto mail.com> wrote in message
news:#8******** ******@tk2msftn gp13.phx.gbl...
How do I request the actual page name that I'm on? This is going to go into an include file, and depending on which page I'm on, I'd like to do
different things. I'm looking for "pagename.a sp"

Jul 19 '05 #3
middletree, I've noticed that a lot of your questions are answered in very
straightforward articles at www.aspfaq.com. In order to save yourself some
time, I might suggest searching there before posting here.
http://www.aspfaq.com/2072

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"middletree " <mi********@hto mail.com> wrote in message
news:#8******** ******@tk2msftn gp13.phx.gbl...
How do I request the actual page name that I'm on? This is going to go into an include file, and depending on which page I'm on, I'd like to do
different things. I'm looking for "pagename.a sp"

Jul 19 '05 #4
Not to sound defensive, but actually, 95% of the time, I do check
aspfaq.com. I find it a very valuable resource, and have a great
appreciation of it and you for making the site happen. In this case, I did
not check it, and I should have.
"Aaron Bertrand - MVP" <aa***@TRASHasp faq.com> wrote in message
news:us******** *****@TK2MSFTNG P10.phx.gbl...
middletree, I've noticed that a lot of your questions are answered in very
straightforward articles at www.aspfaq.com. In order to save yourself some time, I might suggest searching there before posting here.
http://www.aspfaq.com/2072

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"middletree " <mi********@hto mail.com> wrote in message
news:#8******** ******@tk2msftn gp13.phx.gbl...
How do I request the actual page name that I'm on? This is going to go

into
an include file, and depending on which page I'm on, I'd like to do
different things. I'm looking for "pagename.a sp"


Jul 19 '05 #5

Is there a problem with the home page hanging Aaron?

Brynn
On Tue, 20 Jan 2004 13:08:01 -0500, "Aaron Bertrand - MVP"
<aa***@TRASHasp faq.com> wrote:
middletree, I've noticed that a lot of your questions are answered in very
straightforwar d articles at www.aspfaq.com. In order to save yourself some
time, I might suggest searching there before posting here.
http://www.aspfaq.com/2072

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"middletree " <mi********@hto mail.com> wrote in message
news:#8******* *******@tk2msft ngp13.phx.gbl.. .
How do I request the actual page name that I'm on? This is going to go

into
an include file, and depending on which page I'm on, I'd like to do
different things. I'm looking for "pagename.a sp"



Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
Jul 19 '05 #6
Uh, not that I can tell.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Brynn" <z@z.com> wrote in message
news:40******** ******@news.com cast.giganews.c om...

Is there a problem with the home page hanging Aaron?

Brynn
On Tue, 20 Jan 2004 13:08:01 -0500, "Aaron Bertrand - MVP"
<aa***@TRASHasp faq.com> wrote:
middletree, I've noticed that a lot of your questions are answered in verystraightforwar d articles at www.aspfaq.com. In order to save yourself sometime, I might suggest searching there before posting here.
http://www.aspfaq.com/2072

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"middletree " <mi********@hto mail.com> wrote in message
news:#8******* *******@tk2msft ngp13.phx.gbl.. .
How do I request the actual page name that I'm on? This is going to go

into
an include file, and depending on which page I'm on, I'd like to do
different things. I'm looking for "pagename.a sp"



Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!

Jul 19 '05 #7
Are you sure you weren't loading your own site? ;]

Ray at work

"Brynn" <z@z.com> wrote in message
news:40******** ******@news.com cast.giganews.c om...

Is there a problem with the home page hanging Aaron?

Brynn

www.coolpier.com

Jul 19 '05 #8
I can vouch for this. Middletree searches many places before posting! :]

Ray at work

"middletree " <mi********@hto mail.com> wrote in message
news:e%******** ********@TK2MSF TNGP12.phx.gbl. ..
Not to sound defensive, but actually, 95% of the time, I do check
aspfaq.com. I find it a very valuable resource, and have a great
appreciation of it and you for making the site happen. In this case, I did
not check it, and I should have.
"Aaron Bertrand - MVP" <aa***@TRASHasp faq.com> wrote in message
news:us******** *****@TK2MSFTNG P10.phx.gbl...
middletree, I've noticed that a lot of your questions are answered in very straightforward articles at www.aspfaq.com. In order to save yourself

some
time, I might suggest searching there before posting here.
http://www.aspfaq.com/2072

Jul 19 '05 #9

It is getting to this point when viewing source, then hanging for me
... everytime?
<html>
<head>
<title>ASP FAQ</title>

<script>
function showGrad(el,s,e ,t) { document.all(el ).style.filter =
"progid:DXImage Transform.Micro soft.Gradient(G radientType=,
StartColorStr=' "+s+"', EndColorStr='"+ e+"')"; }
function a(el)
{
if (document.all)
{
//document.body.s tyle.cursor = 'pointer';
//showGrad(el, '#FFFFFF', '#bfd3ee');
document.all(el ).style.color = "#6666cc";
}
}
function b(el)
{
if (document.all)
{
//document.body.s tyle.cursor = 'default';
//document.all(el ).style.filter = "";
document.all(el ).style.color = "#333399";
}
}
</script>
<style>

* { font-family:franklin gothic medium, tahoma, verdana;
font-size:x-small; }
..td1 { margin-top: 1px solid #8aa6cb }
..menuTD { border-left:1px solid
#6884a9;cursor: hand;color:#333 399;padding-left:4px; padding-right:4px;
}
..menuON { border-left:1px solid
#6884a9;color:# FFFFFF;padding-left:4px; padding-right:4px; }
..rTD { cursor:hand;col or:#333399;padd ing-left:4px;
padding-right:4px;font-size:12px; }
..nTD { padding-right:10px;font-size:12px; }
..sTD { border-right: 1px solid
#cccccc;padding-left:4px;paddin g-right:4px;font-size:12px; }
..sTD2 { padding-left:4px;paddin g-right:4px;font-size:12px; }
..result { font-size:12px; }
..menuSPAN { font-size:11px;paddi ng-left:4px; padding-right:4px; }
..footer { font-size:9px; }
..footerON { font-size:9px; color:#ff7800 }
INPUT, SELECT { font-size: 12px }
a { color:#333399; text-decoration:unde rline; padding-left:2px;
padding-right:2px }
a:hover { text-decoration:none ; color:#ff7800; }
a.menu { color:#333399; font-size:11px; text-decoration:none ;
padding-left:4px; padding-right:4px }
a.footer { padding-left:0px;paddin g-right:0px;text-decoration:none ;
color:#333399; background:#fff fff }
a.footer:hover { text-decoration:none ; color:#ff7800 }
a.f { padding-left:0px;paddin g-right:0px; text-decoration:none ; }
a.f2 { padding-left:0px;paddin g-right:0px;
text-decoration:none ;font-size:12px; }
a.f2:hover { color:#CC7800 }
a.g {
padding-left:0px;paddin g-right:0px;font-size:11px;color :white;text-decoration:none
}
..g2 { font-size:11px;color :#000080; }
a.g:hover { color:#000080 }
..txt { font-family:franklin gothic medium, tahoma, verdana;
font-size:9px;height :23px;backgroun d:#efefef;borde r:1px solid #a9a9a9
}
..but { border-style:groove; }
..sel { font-family:franklin gothic medium, tahoma, verdana;
font-size:9px;height :18px; }
..headline { font-family:tahoma;f ont-size:17px; }
..code
{
font-family:lucida console,ms gothic,courier
new;font-size:12px;color :#000080;
background:#ece cec;line-height:14px;pad ding-left:15px;
border:1px solid #cccccc;
}
..codeb
{
font-family:lucida console,ms gothic,courier
new;font-size:12px;color :#000080;
}

@media print {
.hidePrint { display:none }
.hideScreen { display:all }
.footer { font-size:11px }
}

@media screen {
.hideScreen { display:none }
}

</style>
</head>

<body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0
marginheight=0 marginwidth=0
bgcolor=#ffffff >
<table border=0 width=100% height=100% cellpadding=0 cellspacing=0>
<tr>
<td bgcolor=#8aa6cb width=150>&nbsp ;</td>
<td>&nbsp;</td>
</tr>
<tr valign=bottom>
<td bgcolor=#8aa6cb width=150><img src=a.gif vspace=55
width=150 height=40></td>
<td><table width=459 border=0 cellpadding=5
cellspacing=0>< tr><td><!-- <b><span class=headline> ASP FAQ
4.0</span></b> -->
<p>We've added and enhanced many new features, including
printer-friendly
articles, a better <a class=f href=kbsearch.a sp>KB
search engine</a>,
site and article <a class=f
href=stats.asp> statistics</a>, and an <a class=f
href=rss.asp>RS S feed</a>.

<p>This is still *your* site. No annoying pop-up ads, no
registration hassles, and no
fees. Just a fresh collection of ASP
and SQL Server articles to help you get your own
sites up and running, and keep them running.
If we help you out, though, remember to consider <a
class=f href=donate.asp >helping
us out</a> as well.

</td></tr></table><p>&nbsp; <p><img src=f.gif width=369
height=135></td>
</tr>
<tr>
<td bgcolor=#8aa6cb width=150 style='border-bottom:1px solid
#FFFFFF'>&nbsp; </td>
<td>&nbsp;</td>
</tr>
<tr height=20>
<td bgcolor=#8aa6cb width=150>&nbsp ;</td>
<td bgcolor=#8aa6cb align=right style='color:wh ite'>
//&nbsp;&nbsp; <a class=g href=search.asp
onclick='this.b lur();'>search</a>&nbsp;&nbsp;& nbsp;//&nbsp;&nbsp; <a
class=g href=kbsearch.a sp onclick='this.b lur();'>kb
search</a>&nbsp;&nbsp;& nbsp;//&nbsp;&nbsp; <a class=g href=news.asp
onclick='this.b lur();'>news</a>&nbsp;&nbsp;& nbsp;//&nbsp;&nbsp; <a
class=g href=categories .asp
onclick='this.b lur();'>categor ies</a>&nbsp;&nbsp;& nbsp;//&nbsp;&nbsp; <a
class=g href=downloads. asp
onclick='this.b lur();'>downloa ds</a>&nbsp;&nbsp;& nbsp;//&nbsp;&nbsp; <a
class=g href=stats.asp
onclick='this.b lur();'>statist ics</a>&nbsp;&nbsp;& nbsp;</td>
</tr>
<tr valign=bottom>
<td bgcolor=#8aa6cb width=150 height=60 align=center
style='border-top:1px solid #FFFFFF'><a href='#' style='padding: 0px'
onclick='docume nt.donation.sub mit();return false;'><img
id='ppal'
src=/img/paypal.gif border=0 align=center hspace=10 title='
Help us pay for hosting.
Keep aspfaq.com ad-free! ' alt=' Help us pay for hosting.
Keep aspfaq.com ad-free! ' width=62 height=31 vspace=10></a></td>
<td>




On Tue, 20 Jan 2004 13:25:59 -0500, "Aaron Bertrand - MVP"
<aa***@TRASHasp faq.com> wrote:
Uh, not that I can tell.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Brynn" <z@z.com> wrote in message
news:40******* *******@news.co mcast.giganews. com...

Is there a problem with the home page hanging Aaron?

Brynn
On Tue, 20 Jan 2004 13:08:01 -0500, "Aaron Bertrand - MVP"
<aa***@TRASHasp faq.com> wrote:
>middletree, I've noticed that a lot of your questions are answered invery >straightforwar d articles at www.aspfaq.com. In order to save yourselfsome >time, I might suggest searching there before posting here.
>http://www.aspfaq.com/2072
>
>--
>Aaron Bertrand
>SQL Server MVP
>http://www.aspfaq.com/
>
>
>
>
>"middletree " <mi********@hto mail.com> wrote in message
>news:#8******* *******@tk2msft ngp13.phx.gbl.. .
>> How do I request the actual page name that I'm on? This is going to go
>into
>> an include file, and depending on which page I'm on, I'd like to do
>> different things. I'm looking for "pagename.a sp"
>>
>>
>
>


Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!



Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1403
by: abbylee26 | last post by:
User enters account number if another account number is needed User clicks add account which creates another row When validating when they hit submit I want to check to make sure they tell us how much money to charge to all account numbers except the first one (all remaining money goes on the first account number) within the header...
6
13958
by: john_williams_800 | last post by:
Hi; I am writing an html page that will live on one server in an ms windows network, but access pictures from a directory on another ms windows server in the network. I know in html the values for img src use unix style path separators with root ( "/" being your parent web directory. However in windows land the path to my images would...
4
5961
by: Nick | last post by:
I'm developing an intranet app, and want to get the current user name for logging purposes. I've turned off anonymous access, and turned on windows authentication in the IIS config. The apps web.config file has authentication mode set to windows, and 'identity impersonate' is set to true. When I try and get the default.aspx page, IE returns...
10
1921
by: Peter Afonin | last post by:
Hello, I have a simple client-side form that is checking the domain availability on the domain registrar's server: <FORM action="https://www.webnames.ru/scripts/RegTimeSRS.pl" method="post"> <input type="hidden" name="thisPage" value="pispCheckDomain"> <input type="hidden" name="username" value="test"> <input type="hidden"...
1
1944
by: bagya | last post by:
please help me out the following is the small code i have <html> <head> <script type="text/javascript"> function validate() { if (document.abc.region.value==0)
1
3177
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as follows: The code below is for the first page:session_start is in line 3 <link href="css/jobSheet.css" rel="stylesheet" type="text/css" /> ...
2
3552
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in uby/Rails. I started it in Perl and gave up on Perl as I went from the 'display the database information on the web page' to the 're-display the information...
0
2900
by: buntyindia | last post by:
Hi, I have a very strange problem with my application. I have developed it using Struts. I have a TextBox With Some fixed value in it and on Submit iam passing it to another page. <html:form action="/login"> <html:text property="userName" value="Bunty"/> <html:submit/>
1
4909
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category order, Input field and a submit button. The Category name is being fetched from the oracle db along with the corresponding Category order. In...
15
7867
denny1824
by: denny1824 | last post by:
I have a working website. I copied all the files to a new folder in inetpub/wwwroot and then set that folder as a Virtual Directory in IIS. I try going to that site from the new folder and i am getting a default error page. It is an aspx page that I am trying to view. If I put in a fake page name it gives a different error about that fake name...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7808
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5087
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.