c# - How to call different JQuery functions from a dropdownlist? -


How do you tie each item in a dropdown list to a different JQuery function?

For example, I have a dropdown with different report names, I want to select drop down to trigger a new report to display every time.

I already sent it to & lt; A href = "#" Id = "btnReport1"> Report 1 which is called $ ("# btnReport1"). Bind ("click", Function () {...}

I want to call the same function above each separate report item in the dropdown list. 5 Or I will need to call either. Is there a way to embed a link, am I using "Change" in some way on "Click"?

I am using Razor and MVC .Net I can do something like @ html. Dropdown list (...) with a selectList object and code is inserted in the controller file if needed. But I prefer to handle HTML though .

As you are trying to bind with the select dropdown, this is the best way to accomplish this. On Change () Handler (for details).

From there, you will decide that the value of the current value Has decided which option at the cutting edge (probably went to get) and if statements or using a series of any other method to an action based on that value.

Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -