0
Next, I have a page that receives age parameters that may vary in quantity.
Example:
url/page.aspx?idade=x&idade=y&idade=z
My idea is to take all the ages passed by url
and select only the largest, see the code below:
var idadePax = Request.QueryString["idade"];
var maxAge = idadePax.Max();
But if I pass 44, 50 and 80 for url
, returns me as the highest number 8, like he doesn’t recognize the ten 80 only the first number as higher. I had tried to use
foreach(String n in idadePax) Int32.Parse(n)
to convert each field to a whole, but I couldn’t apply the logic of the larger one to that, if someone can give me a help or a hint about what I’m sinning at?
Whether you are using web Forms or mvc?
– novic
@Virgilionovic webform
– MSHijo