Can anyone tell me what is the difference between Query and QueryString in C# or Asp.Net.
If you are working with ASP.NET Core, then:
Request.QueryString: Is the raw query string. for example, in http://a.com?name=vahid&lastname=farahmandian the Request.QueryString is ?name=vahid&lastname=farahmandian which is a raw string.
Request.Query: Is a query value collection parsed from Request.QueryString. for example in http://a.com?name=vahid&lastname=farahmandian, the Request.Query is a collection with two members:
Member 1: Key=name and Value=vahid
Member 2: Key=lastname and Value=farahmandian
Which both are parsed from Request.QueryString
Read More: Request.Query: https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.query?view=aspnetcore-7.0#microsoft-aspnetcore-http-httprequest-query
Request.QueryString: https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest.querystring?view=aspnetcore-7.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With