0

How do i get the last part of url after Categoery/?

url: http://localhost:3333/Category/Laptops%2c%20PC%2c%20HardDrives

I've used the following code to get the url, and used it as heading of page

 <h2><%: Page.Request.RawUrl.ToString ()%> </h2>

However I get the following result: /Category/Laptops, PC, HardDrives

I want to get following result: Laptops, PC, HardDrives

bob
  • 1
  • 4

1 Answers1

0

Refer to this answer Last segment of URL

window.alert(this.href.substring(this.href.lastIndexOf('/') + 1));
Monir Tarabishi
  • 716
  • 1
  • 16
  • 30