How to make the Default focus in content page from master page

后端 未结 6 1851
我在风中等你
我在风中等你 2021-01-07 07:57

I have masterpage with content place holder. i have contentpage which is using master page . in all my content page i need to default focus on the text b

6条回答
  •  执念已碎
    2021-01-07 08:25

    Control masterC = 
    Page.Master.FindControl("ContentPlaceHolder1");
        TextBox TextBox1 = 
    masterC.FindControl("TextBoxUsername") as TextBox;
    
    TextBox1.Focus();
    

提交回复
热议问题