Reputation: 445
How can I check if the the current path is one of the following
http://sitename/dirname3/file1.aspx
http://sitename/dirname3/myfile.aspx
...
using regex.
I know how to get the current path, ie
string currentUrl = HttpContext.Current.Request.Url.AbsoluteUri;
Upvotes: 0
Views: 311
Reputation: 50114
Why use a regular expression, rather than just e.g.
HttpContext.Current.Request.Url.AbsoluteUri.StartsWith(pathToCheck);
?
Upvotes: 3