Stefan P.
Stefan P.

Reputation: 331

How can i get the values of parameters from query string in aspx file?

Previously i passed the parameters to my page in a query string. Now, how am i supposed to get them and use them in my page ?

I tried this code and it doesn't work :

<asp:Label runat="server" ID="ShowParameter"><%# Request.QueryString["IDProduct"] %></asp:Label>

Upvotes: 0

Views: 581

Answers (1)

ElGavilan
ElGavilan

Reputation: 6894

You need to use <%= Request.QueryString["IDProduct"] %>. # is used for databinding.

It also goes without saying that you should also check to make sure the query string is not null and that it actually exists. It is also generally not a good idea to directly output a query string like this for a number of reasons.

Upvotes: 1

Related Questions