Pham X. Bach
Pham X. Bach

Reputation: 5432

Get current url with query string

How could I find (file) name with parameters of current page using C# in code behind? E.g with:

mysite.com/folder1/car.aspx?car_id=1&region=3

I want to get the string car.aspx?car_id=1&region=3

Upvotes: 4

Views: 7894

Answers (1)

Gaurang Dave
Gaurang Dave

Reputation: 4046

This should work for you:

Request.Url.AbsolutePath 

Also you can use this :

Request.Url.PathAndQuery

Upvotes: 4

Related Questions