473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help trimming URL path

Hi,
I have the follwing url

http://localhost/testsite/test/webform1.aspx?cat=dog

Is there a function available in the request.url object to return only the
webform1.aspx or even /webform1.aspx?

Thanks
Nov 19 '05 #1
4 1175
maybe this simple idea helps;

System.IO.Path.GetFileNameWithoutExtension(http://localhost/testsite/test/we
bform1.aspx?cat=do);

returns "webform1"...

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
Hi,
I have the follwing url

http://localhost/testsite/test/webform1.aspx?cat=dog

Is there a function available in the request.url object to return only the
webform1.aspx or even /webform1.aspx?

Thanks

Nov 19 '05 #2
Try Request.Url.Segments(Request.Url.Segments.Length - 1)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
Hi,
I have the follwing url

http://localhost/testsite/test/webform1.aspx?cat=dog

Is there a function available in the request.url object to return only the
webform1.aspx or even /webform1.aspx?

Thanks

Nov 19 '05 #3
Thanks Carl. Where can I find info on manupulating the Request.Url object.

Thanks

"Karl Seguin" wrote:
Try Request.Url.Segments(Request.Url.Segments.Length - 1)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
Hi,
I have the follwing url

http://localhost/testsite/test/webform1.aspx?cat=dog

Is there a function available in the request.url object to return only the
webform1.aspx or even /webform1.aspx?

Thanks


Nov 19 '05 #4
http://msdn.microsoft.com/library/de...lrewriting.asp

http://msdn.microsoft.com/library/de...ssUrlTopic.asp

Juan T. Llibre
===========
"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:19**********************************@microsof t.com...
Thanks Carl. Where can I find info on manupulating the Request.Url object.

Thanks

"Karl Seguin" wrote:
Try Request.Url.Segments(Request.Url.Segments.Length - 1)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
> Hi,
> I have the follwing url
>
> http://localhost/testsite/test/webform1.aspx?cat=dog
>
> Is there a function available in the request.url object to return only
> the
> webform1.aspx or even /webform1.aspx?
>
> Thanks


Nov 19 '05 #5

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

Similar topics

3
by: NewmanBT | last post by:
As you can see from the code below, several textboxes will be dynamically created and each will be tied to an org. The ChangeComment function should allow for an update to the database whenever...
8
by: PvtPile | last post by:
I've got a form where i need to pull both the directory of a filename and the directory with the filename of an .inf file... I figured the easiest way to do this was to have an <input id=test...
16
by: ^MisterJingo^ | last post by:
Hi all, I have a variable called root which contains (E:\Web\Websites\fileBrowse\) and then I have a variable called path which uses root, and adds directories on to it (this is part of a file...
1
by: saldelmundo | last post by:
I'm a rookie with vb.net and I'm trying to modify source code that was given to me... in short the program I have is a file copy application... it reads a file name and path from a given txt file...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.