What does this line of code do? I'm relatively new to C# and I've been trying to figure it out by reading about TryParse and Request.Form, however, I think a more comprehensive explanation would help me.
int.TryParse(Request.Form["yearhidden"], out year);
TryParse
is taking the value fromRequest.Form["yearhidden"]
Request.Form["yearhidden"]
is a form field in your html calledyearhidden
.TryParse
then attempts to parse it into an integer value. It returnsTrue
if it was successful,False
if not.The value is stored in the variable
year