forums.asp.net forums.asp.net

Validation Firing for Required Fields Populated from Code Behind When Form is Submitted

I have a form for users to submit data, but some fields such as UserID which the model requires are added using code behind as part of the OnPostAsync event. Even though my OnPostAsync should be submitting all the required information the form is throwing an error when I click the submit button and it posts back saying that the UserID field is required.  A sample of my code is as follows: From Posts.cs model: [Required] public...