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

欧美三区_成人在线免费观看视频_欧美极品少妇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條評論
主站蜘蛛池模板: 久久久综合 | 国产精品久久久久久久久免费相片 | 亚洲精品国产网红在线 | 看黄网站在线 | 国产免费A片好硬好爽好深小说 | 国产91精品黄网在线观看 | 污视频在线免费播放 | 天天草夜夜爽 | 国产精品原创巨作av | 丰满年轻岳中文字幕一区二区 | 中文字幕一区在线观看视频 | 麻豆传媒视频入口 | 色综合五月色婷婷开心 | 婷婷国产成人精品视频 | 欧美综合一区二区三区 | 4hu网站| a欧美 | 成人福利在线视频免费观看 | 蜜桃精品噜噜噜成人av | 97碰碰在线视视频 | 干天天| 99久在线观看 | 亚洲涩涩 | 欧美日韩亚洲人人夜夜澡 | jizz18毛片 | 久久综合伊人77777 | 一区二区三区免费 | 奇米影视亚洲四色8888 | 日本小网站 | 日本成人在线网站 | 成人免费网站www网站高清 | 涩色婷婷狠狠第四四房社区奇米 | 国产精品成人观看视频国产 | 91九色精品国产 | 午夜大片| 成人欧美一区二区三区在线观看 | 午夜婷婷精品午夜无码A片影院 | 久久乐国产精品 | 黄色一级在线视频 | 久久久无码精品亚洲日韩按摩 | 玖玖精品|