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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

框架網(wǎng)頁控件獲取焦點??!

最近剛學(xué),遇到了個問題,望高手能幫個忙??!我有兩個文件,一個main.aspx 一個WebForm1.aspx  ,WebForm1.aspx有兩個控件,一個DropDownList1,一個TextBox1main.aspx的 Html代碼:......<frameset id="aa" cols="150,8,*">   <frame name="left" scr="lefttree.aspx">  <frame name="middle" scr="t_l.htm">  <frame name="main" scr="WebForm1.aspx"></frameset>... WebForm1.aspx.cs 代碼也只加了  private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)  {   this.Page.RegisterStartupScript("","<script>document.getElementById('TextBox1').focus();</script>");    }  }只運行WebForm1.aspx時,能實現(xiàn)DropDownList1改變,TextBox1獲得焦點,但運行main.aspx卻不能獲得焦點,而且TextBox1點也點不進去了! 還望各位高手給予指點??!
查看完整描述

2 回答

?
小唯快跑啊

TA貢獻1863條經(jīng)驗 獲得超2個贊

腳本應(yīng)該在page_Load事件中注冊

WebForm1.aspx.cs

 

protected void Page_Load(object sender, EventArgs e)
       {
           if (DropDownList1 != null)
           {
               DropDownList1.Attributes.Add("onchange", "document.getElementById('TextBox1').focus();");
           }
           
       }

 


查看完整回答
反對 回復(fù) 2018-10-26
?
慕慕森

TA貢獻1856條經(jīng)驗 獲得超17個贊

asp:dropdownlist id="DropDownList1" style="Z-INDEX: 101; LEFT: 424px; POSITION: absolute; TOP: 160px" runat="server" AutoPostBack="True">
你這個控件都沒有DropDownList1_SelectedIndexChanged這個事件,沒想通它怎么來的

查看完整回答
反對 回復(fù) 2018-10-26
  • 2 回答
  • 0 關(guān)注
  • 680 瀏覽

添加回答

了解更多

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

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

公眾號

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