Seting Focus to a control

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
10/8/2014 2:56:42 PM
Gravatar
Total Posts 9

Setting Focus to a control

I ran into a little strange situation with the site when setting focus to a control.
I have setup the tab index on my page. All works well until I use the dropdown list in the middle of the page.
Once I make a selection, it set focus to the address bar of the browser.

I created an onchange event for the dropdown list to set focus to the next control, txtText.setfocus(),and it works but the webpage shifts to the left. It shifts almost the entire width of the left content pane, (it is hidden). The right side looks like it is trying to show the right content pane, which is empty, and it is all white space.

Any thoughts?

 

10/8/2014 6:36:19 PM
Gravatar
Total Posts 9

Re: Seting Focus to a control

 I reread my post and don't want to confuse anyone.
The onchange event is the wrong terminology for this. The actual code is below.

code behind--

protected void RentalMake_SelectedIndexChanged(object sender, EventArgs e)

{

        txtRentalModel.Focus();

}

HTML---

<asp:DropDownList ID="ddlRentalMake" TabIndex="6" runat="server" AutoPostBack = "true" OnSelectedIndexChanged="RentalMake_SelectedIndexChanged"><asp:ListItem ></asp:DropDownList>

 

10/10/2014 10:42:26 AM
Gravatar
Total Posts 9

Re: Seting Focus to a control

Nevermind!
This is a debugging issue within VS.
I deployed the page to the live site and it works as intended.

You must sign in to post in the forums. This thread is closed to new posts.