1. the application has a form that allows the user to select/multiselect
  2. the content in the dropdown list are retrieved from a database, not hard coded:

    <select class="btn btn-default col-md-1" name="fy_dropdown" id="fy_dropdown">
        @foreach (var fy in Model.FYIndex)
            <option value="@fy">@fy</option>
  3. the layout (column name, style etc) of the form is in the script folder, as a .js file, the content in the dropdown list is in the view folder, as a .cshtml file.

so my question is 1. why is the layout and content defined in separate places? 2. I want to make some fields marked with an asterisk, and if unselected, the field will display a warning (like a red box) at client side. How should I do it? Should I add some required attribute in the cshtml file? 3. I want the field to display to the user which one/several fields are selected. How should I do it? 4. Since under each field there are many options, how do I implement a search box (case insensitive) inside the dropdown list?

I am new to the mvc model, so I really appreciate any help that can help me understand, thanks!

Related posts

Recent Viewed