Explain program to call the js function when the change is being made in the Dropdown list made in ASP.NET MVC?
Submitted by: Administrator- To call the function of the js (JavaScript) in the dropdown list in ASP.NET MVC the function has to be written like:
<script type="text/javascript">
function selectedIndexChanged() { }
</script>
- The function need to be called using the code nuggets or if the Razor view engine the the js has to be integrated as:
<%:Html.DropDownListFor(x => x.SelectProduct, new SelectList(Model.Products, "Value", "Text"), "Select product", new { id = "dpDown", onchange="selectedIndexChanged()" })%>
Submitted by: Administrator
<script type="text/javascript">
function selectedIndexChanged() { }
</script>
- The function need to be called using the code nuggets or if the Razor view engine the the js has to be integrated as:
<%:Html.DropDownListFor(x => x.SelectProduct, new SelectList(Model.Products, "Value", "Text"), "Select product", new { id = "dpDown", onchange="selectedIndexChanged()" })%>
Submitted by: Administrator
Read Online ASP.Net MVC Job Interview Questions And Answers
Top ASP.Net MVC Questions
☺ | What is ASP.NET MVC? |
☺ | What is repository pattern in MVC.NET? |
☺ | Explain the page lifecycle of an ASP.NET MVC? |
☺ | Explain program to call the js function when the change is being made in the Dropdown list made in ASP.NET MVC? |
☺ | Explain significance of routing? |
Top Dot Net Technologies Categories
☺ | MSF Interview Questions. |
☺ | .Net Architecture Interview Questions. |
☺ | ASP.Net MVC Interview Questions. |
☺ | Entity Framework Interview Questions. |
☺ | C# (Sharp) Programming Language Interview Questions. |