我创建了一个包含 Javascript 和函数的视图,如下所示:
@functions
{
    public int DaysInMonth(string Month)
    {
         //code to get the no of days in month;
    }
}
我有包含月份的下拉列表。现在我想使用 jQuery 在下拉列表的更改事件上编写代码,这将调用上述函数。
<script type="text/javascript">
    $(function () {
        $('#Months').live('change', function () { 
           //code to call the above function  
        });
    });
</script>
这里('#Months') is the id的下拉列表..
注意:以上两个代码片段都在同一个视图(索引)中。
我如何链接上面的两个代码片段?
谢谢..