Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get current page in C#

Tags:

c#

asp.net

For instance if I have http://www.mywebsite.com/about.aspx. Store about.aspx (or whatever page we're on) in a variable. Also need this to work even if there is information after the page in the url such as a query string.

like image 334
The Muffin Man Avatar asked Jan 29 '26 10:01

The Muffin Man


1 Answers

Ah - I suggest you read the ASP.NET documentation VERY carefully. The HttpRequest object, available as Request property contains all information that you can have about the request. This includes the path called, all parameters etc.

like image 194
TomTom Avatar answered Feb 01 '26 02:02

TomTom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!