[Solved] cannot apply indexing with [] to an expression of type QueryString



Questions: Am trying to get the data from an Asp.Net Core Request Query String but the compiler won't let me. It shows a red squiggly line saying "cannot apply indexing with [] to an expression of type QueryString". 

Answer: If you are using Request.QueryString["Name"] change it to Request.Query["Name"]. Let me know if this helps.

According to Intellisense, The Request.QueryString is used to set or get query string used to create a query collection in Request.Query. While Request.Query gets the query value collection parsed from the Request.QueryString.

Asp.Net Core QueryString cannot apply indexing Technology published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue


© 2021 - ErnesTech - Privacy