Quote:
string nom = formCollection["hfNom"].ToString();
That's the line that's causing the exception, because
formCollection["hfNom"]
is returning
null
, and you then try to call
.ToString()
on it.
But the indexer already returns a
string
, so you don't need that
.ToString()
call at all:
string nom = formCollection["hfNom"];
Now you just need to work out why you're not passing a value in that field.