ASP.NET 2.0 simplified this problem and introduce a concept of "default focus". There is a new DefaultFocus attribute that allows you to easily set focus to desired controls. The sample HTML code bellow will set focus on control named textbox1:
<form id="Form1" defaultfocus="textbox" runat="server">
<asp:textbox id="textbox1" runat="server"/>
<asp:textbox id="textbox2" runat="server"/>
<asp:button id="button1" text="Button1" runat="server"/>
ASP.NET 2.0 provides three different new solutions if you need to set focus dynamically. At run time you can use Page.SetFocus method with control's ID as a parameter or you can simply call a new control's Focus method. They both do practically the same thing. It is only programmer's choice to choose which method likes more.
There is also DefaultFocus property of the form element. Set this property to ID of wanted control, run the project and that control will get focus when page is first time loaded.
1: pnlLookupDetail.Visible = True
The Full Article can be found here, http://www.beansoftware.com/asp.net-tutorials/focus-asp.net.aspx