Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help trimming URL path

Reply
Thread Tools

Help trimming URL path

 
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      12-14-2004
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
 
Reply With Quote
 
 
 
 
Emre Guldogan
Guest
Posts: n/a
 
      12-14-2004
maybe this simple idea helps;

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

returns "webform1"...

"Chris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      12-14-2004
Try Request.Url.Segments(Request.Url.Segments.Length - 1)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


"Chris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      12-14-2004
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Juan T. Llibre [MVP]
Guest
Posts: n/a
 
      12-14-2004
http://msdn.microsoft.com/library/de...lrewriting.asp

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





Juan T. Llibre
===========
"Chris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > 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

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Security trimming problem with not absolute path Alexj ASP .Net Security 0 02-23-2010 08:14 AM
Trimming filename and paramters from a URL (output from DB) Simon ASP General 2 10-28-2004 06:31 PM
Make a relative url path from an absolute path to another one Thomas Guettler Python 3 10-27-2003 04:41 PM
Trimming data in dropdownlist from sqldatareader William Mild ASP .Net 2 10-23-2003 12:51 PM
Re: Trimming Blank Spaces in String Steve C. Orr, MCSD ASP .Net 1 08-09-2003 12:46 AM



Advertisments