ASP.NET - How to remove the query string after / before? from passing the ASPX parameter?
I would like to parse values from aspx pages like what is passed before? and after that? So what is the C # function that allows me to parse this?
I would like to do something like:
var pageType = parameter.trimBefore?();
var pageString = parameter.trimAfter?();
Thanks for any advice.
0
Dvojrak
a source
to share
4 answers
Request.Url will give you the Uri - unfortunately it won't give you the power you would like to receive on request.
Something like Request.Url.Segments will give you a collection of all the parts before?
Then, using Request.QueryString , you will get the name-value of the querystring values - remember that some query elements can contain multiple comma-separated values, which is why the example in the docs has an inner loop.
0
a source to share