Design a site like this with
Get started

Call a function when the view loads in an MVC application

Solution Document.ready function is for this purpose. For example, you want to call a function that fills a drop-down dynamically when the view loads, you will give that function a call in document.ready function enclosed in the script tag <script> $(document).ready(function () { fillRoles(); }); </script> In the above example, function fillRoles() is called to... Continue Reading →

Create a free website or blog at

Up ↑