in Education by
I have a Login control placed inside LoginView control contained within a PANEL. I want to set login button as the default button for this panel. It is not possible in design view to set the default button. So i am trying to set it using code. Below is the code: protected void SetDefaultButtonForLoginControl() { Login loginCtrl = (Login)LoginView1.FindControl("Login1"); Panel panel1 = (Panel)LoginView1.FindControl("Panel1"); if (loginCtrl != null) { Button btn = (Button)loginCtrl.FindControl("btnLogin"); if (btn != null) { panel1.DefaultButton = btn.ClientID; } } } I am getting both the controls i.e. Panel and Button but the code generates the following error message - The DefaultButton of 'Panel1' must be the ID of a control of type IButtonControl. I have also tried using UniqueID instead of ClientID but still the same problem. Can anyone help me out, how this error can be rectified? Thanks for sharing your time. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I know you've said that you tried ClientID and UniqueID, however I used UniqueID and it worked for me.

Related questions

0 votes
    i create this class and it have this constructor : public class ReturnResult : ImplicitReturnResult { public bool ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    So the problem is i don't get get a value from textbox field on GridView RowUpdating event. Here ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I'm working on a DNN skin using Christoc's DNN templates and when I create a normal ASP.NET ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I have a database (SQL Server) with clients and a MVC plataform, and i want a row to be "hidden ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have a database (SQL Server) with clients and a MVC plataform, and i want a row to be "hidden ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    For example, I have an ASP.NET form that is called by another aspx: string url = "http:// ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I have a master page with a form element and the defaultbutton attribute set to a server-side ImageButton. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 16, 2022 in Education by JackTerrance
0 votes
    I have tried many solution online but I am unable to fix. First off all i check in bin and it ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have added ASPXUploadControl to save the Image File. I want to apply Validation (Required Field Validation ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    In Azure, I have a small app deployed: https://jsnamespace.azurewebsites.net/. In localhost, it works ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    In Azure, I have a small app deployed: https://jsnamespace.azurewebsites.net/. In localhost, it works ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 10, 2022 in Education by JackTerrance
0 votes
    I am refactoring some CSS on a website. I have been working on, and noticed the absence of traditional ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    I am refactoring some CSS on a website. I have been working on, and noticed the absence of traditional ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
0 votes
    Which are the events of an ASP .Net server control and how does their order relate to the containing ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 12, 2022 in Education by JackTerrance
0 votes
    I have been developing a webpage which uses n number of dropdownlists which are binding dynamically inside a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
...