❔ I have a project that I need to submit in 6 hours, but I'm stuck at one point.
Project:
The project aims to develop a web interface where a minimum of 3 and a maximum of 5 people's names, surnames, and birthdates can be entered. The tasks to be done within this scope are as follows:
A web interface should be developed for entering the information of the individuals. The controller related to the information input should be as follows:
Name and surname fields cannot be left blank.
The birthdate cannot be a date later than the current date.
The birthdate cannot be a very old date.
The data entered should be processed on the server-side using Razor Pages server-side .NET web technology. The calculation of age is expected to be performed on the server-side.
After entering the information of 3 people from the web interface, they should be sorted from youngest to oldest and from oldest to youngest. The symbol "=" can be used between individuals of the same age in the display. An example display for 3 individuals is shown below:
The entered person information from the web interface is expected to be stored in appropriate data structures in memory on the server-side. There is no expectation of saving and retrieving data from a database.
The problem I'm facing:
I'm adding the form data to object (People.Add(person);). However, since the form has a submit button, the page is being refreshed and everything I added is getting deleted.
6 Replies
You might want to use JavaScript to add an element directly to the page, without it refreshing, and also having the ability to parse the data using your controller.
I can't use js, this is the project rule.
Hm then you could have a list of the previously entered information, to which you would add every time the user submits, and then just pass said list and the IndexModel into a ViewModel?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.