0

I've recently started learning asp.net programming and am now fiddling with my small "project"

In it i have 2 models for my database : 1) Film - which consists of name,id, category(type of category model), other random properties and a DATE

2) Category - which consists just of the name of the category and id.

I want to create a form where i type a start date and an end date and choose a category. After i submit this form i want my controller to return Data from database where the data falls into range (start date - end date) and category which were chosen.

So my question is do i need another model for "data range" and the form or can i just write a javascript function or something similar and it can return data directly to my view. I'm a little lost and i have no one to ask, so maybe someone can help me.

Thanks

ems19
  • 23
  • 6
  • 1
    [This answer](https://stackoverflow.com/questions/29142422/rendering-partial-view-on-button-click-in-asp-net-mvc/29142790#29142790) might help you to get started. –  Jul 18 '18 at 10:25
  • You can write a basic html form (no javascript required) that _posts_ your parameter values (start date, end date, category) to the controller. The controller takes those parameters and returns a "view" (a html page populated from data that is worked out in your controller). Here's a basic example https://jonhilton.net/2017/08/17/how-to-get-data-from-an-html-form-to-your-asp.net-mvc-core-controller/ – Nick.Mc Jul 18 '18 at 10:35

0 Answers0