473,230 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

to set focus to a control which is in a panel in asp.net 2.0

11
Hi

I'm new to this asp.net environment .. i have aproblem like i have a asp page with multiple panel ... the page's default focus is already set to a text box in a panel... now when i click a button in say panel 1 . a model popup panel gets loaded ... now i have to set the focus to the control in that model pop up panel..
i'm not sure how to do it... can anyonehelp me in this regard .. thanks in advance
May 11 '07 #1
4 9927
swifty
1
Hi,
I'm also new to ASP.NET 2.0 and had a simular problem.
I had a focus on my desired textbox but since I moved that textbox inside a panel + and moved tat panel in an AJAX UpdatePanel I loose the focus.
When the page loads you can see for 0,5 seconds the cursor in the textbox and than it goes simply away.
First I thought it had to do with the complicated loading mechanisme of AJAX but when I moved the textbox out of the panels there was no problem.
Can Some help me?
May 23 '07 #2
bujjai
8
Hi

I'm new to this asp.net environment .. i have aproblem like i have a asp page with multiple panel ... the page's default focus is already set to a text box in a panel... now when i click a button in say panel 1 . a model popup panel gets loaded ... now i have to set the focus to the control in that model pop up panel..
i'm not sure how to do it... can anyonehelp me in this regard .. thanks in advance
if it is textbox putlike this ....

txt_box1.Focus(); particular panel ok...
i think it works based on my understand.. if not send me i will do and try
May 23 '07 #3
try this on page load

onload="javascript:document.FormName.txtBoxId.focu s();"
May 24 '07 #4
Setting the focus on page/form load is not a solution.

Use the proxylink for the ModalPopupextender and use another link button to show/hide the panel.

<asp:LinkButton ID="AddUserLink" runat="server" OnClick="AddUserLink_Click">[Search Active Directory]</asp:LinkButton>
<asp:LinkButton ID="AddUserLinkProxy" runat="server"></asp:LinkButton>
<%--<asp:LinkButton ID="PreviewLinkButton" runat="server" CausesValidation="true" OnClientClick="PopUp('CodeSetMaintenance.aspx');" >LinkButton</asp:LinkButton>--%>
<asp:LinkButton ID="PreviewLinkButton" runat="server" CausesValidation="true" OnClientClick="PopUp('CodeSetMaintenance.aspx');" ></asp:LinkButton>
<ajax:ModalPopupExtender runat="server" ID="FindUserPopup" BackgroundCssClass="modalBackground" TargetControlID="AddUserLinkProxy" PopupControlID="FindUserPanel" CancelControlID="FindUserCloseButton"></ajax:ModalPopupExtender>


<asp:Panel runat="server" ID="FindUserPanel" CssClass="ModalWindow" DefaultButton="FindUserButton" >
<table>
<tr>
<td class="FieldCaption">Name:</td>
<td class="Spacer">&nbsp;</td>
<td class="FieldValue">
<asp:TextBox runat="server" ID="FindUserNameText"></asp:TextBox>
<asp:Button runat="server" ID="FindUserButton" Text="Find" OnClick="FindUserButton_OnClick" />

</td>
</tr>

</table>
</asp:Panel>

in the code behind

protected void AddUserLink_Click(object sender, EventArgs e)
{
FindUserNameText.Focus();
FindUserPopup.Show();

}

post if you anyone of you found any simple solution.
Sep 5 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: codymanix | last post by:
I have a panel which is located in a AutoScroll-enabled panel. The problem is when I click in the panel, the contining panel automatically scrolls to position (0,0). How can I get around this...
2
by: IMRAN SAROIA | last post by:
Hi! Please advise how to set focus to any control on Web and Windows Forms. Regards Imran
3
by: Dave | last post by:
We are developing a web page that shows large graphics. To provide more screen space for the graphics, we allow the user to popup a window that places itself over the top part of the browser. This...
1
by: Workgroups | last post by:
Not having much luck tracking this down... I'm working with a form, Form1, which contains a panel called pnlParent. Both Form1 and pnlParent have AutoScroll = False. pnlParent contains a panel...
1
by: mongphong28 | last post by:
Hi, I'm using a treeview as a menu, and when the user clicks on a node I want the focus to set to a control (ie textbox) in a panel to the right. The problem I'm having is the focus will not...
0
by: =?Utf-8?B?R2FyeSBX?= | last post by:
Here is my problem. I have a datagrid that when you click on a row, it goes into edit mode and depending on where I clicked it the focus is on that control using Control.Focus(). I also have code...
4
by: pablorp80 | last post by:
Hello, Here is what I need: I need the focus and the cursor set to a textbox named txtGT, every time no matter if it is the first page load or whether it is a postback. Here is the problem: I...
8
by: Mel | last post by:
I have several text boxes and drop-down lists in an AJAX Update Panel. All user inputs have the Postback property set to True. After I type something in the first input entry and press the "Tab"...
3
by: Rich P | last post by:
One thing I have noticed with .Net is that various controls can have the same tab index and the app still compiles. I would set the tab index of your splitter to some large number (larger than a...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.