The form[fieldname] method returns a string, which does not have a .Value() method. You use Int32.Parse() and DateTime.Parse().
Radio button and date's problem my ASP.NET
Harun Ergün
260
Reputation points
Friends, first of all hello.
I'm designing a simple form site. But I'm getting an error. Texts are writing to the database, but the radio button and date does not write the error explodes. I left the whole code for you to review. I need help
2 answers
Sort by: Most helpful
-
-
AgaveJoe 26,141 Reputation points
2023-05-11T15:22:40.4533333+00:00 I recommend that you learn MVC model binding which handles type validation and converting the post parameters into a type.
If we go with your current approach, then you need to validate, which is not included, and convert the inputs yourself.
DateTime dt = DateTime.ParseExact(Request.Form["LisansBasLangicTarihi"], "dd/MM/yyyy", CultureInfo.InvariantCulture); int num = int.Parse(Request.Form["Gender"]);