如何在每次更改ASP .NET中的下拉选项时显示加载图像 [英] How to display loading image each time when we change drop downs selection in ASP .NET

查看:46
本文介绍了如何在每次更改ASP .NET中的下拉选项时显示加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

In my application i have two drop downs one is year drop down and second is month drop down and below is my jquery function
which i had used to display loading image on the selection change of each drop down but this javascript function is working only for 
first time of my drop down selection and it is working only for one drop down it is not showing for second drop down i had tried 
with onchange event also by calling it in my dropdownlist but its not working


<pre lang="Javascript"><script type="text/javascript">
            $(function year() {
                $(".modal1").hide();
                $("#ddlYear").change(function year() {
                    $(".modal1").show();
                    var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
                    var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
                    modal1.css({ top: top, left: left });
                });
            });
           
        </script>
    <script type="text/javascript">
        $(function month() {
            $(".modal1").hide();
            $("#ddlMonth").change(function month() {
                $(".modal1").show();
                var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
                var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
                modal1.css({ top: top, left: left });
            });
        });
    </script>
<asp:DropDownList ID="ddlYear" runat="server" Height="22px" Width="121px" OnSelectedIndexChanged="ddlYear_SelectedIndexChanged" onchage="validate year();" AutoPostBack="True">
 <asp:DropDownList ID="ddlMonth" runat="server"  Height="22px" Width="121px" AutoPostBack="True" onchage="validate month();"  OnSelectedIndexChanged="ddlMonth_SelectedIndexChanged">





我尝试过:



i尝试通过调用我的函数在ocodage的drodownlist但是它没有wroking



What I have tried:

i had tried by calling my function in ochnage of drodownlist but its not wroking

推荐答案

(函数年(){

< br>

(。modal1)。hide();
(".modal1").hide();


(#ddlYear)。change(function year(){
("#ddlYear").change(function year() {


这篇关于如何在每次更改ASP .NET中的下拉选项时显示加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆