第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

ListView控件,加一個(gè)客戶(hù)端的JS代碼,就不能插入、更新了!?

ListView控件,加一個(gè)客戶(hù)端的JS代碼,就不能插入、更新了!?

郎朗坤 2018-12-07 09:50:45
需求:一個(gè)用戶(hù)表 字段為 名字,年齡 和性別 (性別是CheckBox ),要求:CheckBox 選中時(shí)為男性,不必填寫(xiě)年齡,(即插入項(xiàng),年齡輸入框隱藏,[color=#FF6600]用js實(shí)現(xiàn)[/color])不選中時(shí)為女,年齡框可見(jiàn), js和程序效果我都實(shí)現(xiàn)了,奇哉怪也的是:InputAttributes["onchange"] = "changeed(this,'" + txtage.ClientID + "')";時(shí), 插入,更新都不可用了?。〖丛?編輯、插入時(shí),填好數(shù)據(jù)后,點(diǎn)更新或插入,數(shù)據(jù)會(huì)被清空,且維持編輯狀態(tài)不變,經(jīng)探索:毛病出在 "changeed(this,'" + txtage.ClientID + "')"; 把此javascript函數(shù)的形式改一下 即 不用txtage.ClientID 或其他字符串時(shí),該現(xiàn)象就會(huì)消失??!不知所以然,望高手指教我的源代碼在:http://www.w8le.com/lkfup/Solution1.rar ? protected void ListView1_ItemCreated(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem || e.Item.ItemType == ListViewItemType.InsertItem) { CheckBox chb = e.Item.FindControl("UserGenderCheckBox") as CheckBox; TextBox txtage = e.Item.FindControl("UserAgeTextBox") as TextBox; if (chb != null && txtage !=null) { //chb.Attributes["onchange"] = "changeed(this,'" + txtage.ClientID + "')"; chb.InputAttributes["onchange"] = "changeed(this,'" + txtage.ClientID + "')"; } } }
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 500 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)