4

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

2
  • Are you using WebForms, Asp.Net-mvc, or Weg Pages? Commented Mar 26, 2018 at 2:13
  • @ErikPhilips I use Web forms Commented Mar 26, 2018 at 2:17

1 Answer 1

4

This should work for you:

Request.Url.AbsolutePath 

Also you can use this :

Request.Url.PathAndQuery
Sign up to request clarification or add additional context in comments.

1 Comment

A thank you, using Request.Url.PathAndQuery and Substring resolve my issue!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.