Is it possible to call a method with a # from a view?

For example:

There is a big sign (2) with user id and dates, I see 2 dropboxes

  1. User ID

  2. dates from table 2

I want to do it after choosing a user, a code was launched that selects the necessary dates from a large table (according to the user selected in 1 dropbox) and inserts it into dropbox 2

UPD Example: After selecting a user (see screenshot field - 1), the list of dates for this user is loaded from another table (see screenshot field - 2)

Example: After selecting a user (see screenshot field - 1), the list of dates for this user is loaded from another table (see screenshot field - 2)

    1 answer 1

    If we are talking about the MVC model, the issue is solved by creating a controller.

    public ActionResult Index(string SearchStringID) { var Users = from users in db.Users select users; if (!String.IsNullOrEmpty(SearchString)) { Users = Users.Where(s => s.Name.Contains(SearchStringID)); } return View(Users.ToList()); } 

    something like this should be (except names, of course)

    • Yes, about it and need! I understand that the index takes the user ID and returns what is needed. And how will this method be called after choosing a name? - Mikhail Akimov
    • About the choice of the name did not understand. - R0manych
    • I updated the question, added an example with a screenshot, I hope I understood it clearly - Mikhail Akimov
    • and so it’s just asking for the request to return the list of dates and display it. Here's a guide to searching in asp.net asp.net/mvc/overview/getting-started/introduction/adding-search - R0manych
    • But duck is the same search filter. I need almost the same thing, but without the filter button. T e event when changing dropbox. - Mikhail Akimov