---選擇鄉鎮---沂城街道道托鎮高橋鎮

欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

ASP.NET驗證控件CustomValidator客戶端驗證Drop

系統 2112 0

?

      
        <
      
      
        asp:DropDownList 
      
      
        ID
      
      
        ="
        
          
            ddlTown
          
        
        "
      
      
         runat
      
      
        ="server"
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="-1"
      
      
        >
      
      ---選擇鄉鎮---
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="沂城街道"
      
      
        >
      
      沂城街道
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="道托鎮"
      
      
        >
      
      道托鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="高橋鎮"
      
      
        >
      
      高橋鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="馬站鎮"
      
      
        >
      
      馬站鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="楊莊鎮"
      
      
        >
      
      楊莊鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="富官莊鎮"
      
      
        >
      
      富官莊鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="圈里鄉"
      
      
        >
      
      圈里鄉
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="沙溝鎮"
      
      
        >
      
      沙溝鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="諸葛鎮"
      
      
        >
      
      諸葛鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="泉莊鎮"
      
      
        >
      
      泉莊鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="龍家圈鎮"
      
      
        >
      
      龍家圈鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="黃山鋪鎮"
      
      
        >
      
      黃山鋪鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="崔家峪"
      
      
        >
      
      崔家峪
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="夏蔚鎮"
      
      
        >
      
      夏蔚鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="高莊鎮"
      
      
        >
      
      高莊鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="沂蒙風情旅游區(院東頭鎮)"
      
      
        >
      
      沂蒙風情旅游區(院東頭鎮)
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="許家湖鎮"
      
      
        >
      
      許家湖鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="四十里鎮"
      
      
        >
      
      四十里鎮
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        <
      
      
        asp:ListItem 
      
      
        Value
      
      
        ="開發區"
      
      
        >
      
      開發區
      
        </
      
      
        asp:ListItem
      
      
        >
      
      
        </
      
      
        asp:DropDownList
      
      
        >
      
      
        <
      
      
        asp:CustomValidator 
      
      
        ID
      
      
        ="CustomValidator1"
      
      
         runat
      
      
        ="server"
      
      
         ErrorMessage
      
      
        ="*請選擇鄉鎮"
      
      
         ClientValidationFunction
      
      
        ="ChkDropDownList"
      
      
         ControlToValidate
      
      
        ="ddlTown"
      
      
        ></
      
      
        asp:CustomValidator
      
      
        >
      
    


需要的js:

      
        function
      
      
         ChkDropDownList(source, args) {

                        
      
      
        if
      
       (args.Value == "-1"
      
        )//當下拉菜單選擇的是-1的時候,就是沒有選擇

                            args.IsValid 
      
      = 
      
        false
      
      
        ;

                        
      
      
        else
      
      
        

                            args.IsValid 
      
      = 
      
        true
      
      
        ;

                    }  
      
    

?

http://blog.163.com/dreamman_yx/blog/static/2652689420107542140761/

?

?設置Dropdownlist選中:

      
        public
      
      
        void
      
       selectValue(DropDownList ddl, 
      
        string
      
      
         value)

        {

            
      
      
        foreach
      
       (ListItem item 
      
        in
      
      
         ddl.Items)

            {

                
      
      
        if
      
       (value ==
      
         item.Value)

                    item.Selected 
      
      = 
      
        true
      
      
        ;

            }

        }
      
    

下拉菜單設置選中項: ddlCity. SelectedIndex = ddlCity.Items.IndexOf ( ddlCity.Items.FindByText ( cityname ));

?

?

?

?

?

ASP.NET驗證控件CustomValidator客戶端驗證DropDownList、TextBox


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美1级| 农村寡妇偷人高潮A片小说 午夜爱爱爱爱爽爽爽网站免费 | 性欧美一级毛片在线播放 | 一区二区免费在线观看 | 国产淫语对白在线视频 | 欧美精品区 | 欧美激情欧美激情在线五月 | 热久久这里只有精品 | 精品国产欧美一区二区 | 久久久久久久国产精品 | 成人午夜免费剧场 | 欧美另类色图 | 久久福利青草精品免费 | 欧美精品在线免费观看 | 99精品视频在线这里只有 | 亚洲欧洲精品视频在线观看 | 欧美日韩精品一区二区在线播放 | 色艹 | 奇米色在线 | 亚洲免费在线看 | 日本最新中文字幕 | 97丨九色丨国产人妻熟女 | 在线观看日韩中文字幕 | 国产午夜亚洲精品国产 | 欧美黑b| 美女吊逼 | 99国产精品2018视频全部 | 三级免费网 | www.99热这里只有精品 | 亚洲AV国产成人精品区三上 | 国产精品夜色一区二区三区 | 国产免费观看视频 | 这里只有精品99re | cao视频| 欧美日韩精品一区 | 欧美日韩一二三区 | 黄色在线观看国产 | 特级黄色小说 | 久久九九国产精品怡红院 | 日韩电影在线看 | 日本一级淫片1000部 |