Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How to set focus to Ajax combobox

$
0
0

Hello: I have a web app with a formview control that has an ajax combobox in it:

 

<%--     AJAX COMBO BOX CONTROL:--%><asp:ComboBox ID="ddCompanyName" DropDownStyle="Simple" AutoCompleteMode="Append" runat="server" TabIndex="1"  DataSourceID="SqlDataSourceCompanyName" DataTextField="companyname" DataValueField="companynameId" SelectedValue='<%# Bind("companyname")%>'></asp:ComboBox><%--     END AJAX COMBO BOX CONTROL:--%>

I need to set the focus on this control when the page loads. I have tried to do it on the server side of my code:

 Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Page.IsPostBack Then
        Else
           ScriptManager1.SetFocus(MainContent_frmCustomerInformation_ddCompanyName_ddCompanyName_TextBox.ClientID)
        End if
    End Sub

But it's not happy with my choice of client ids. to find what it was, I was running the page and viewing the source.

Am I on the right track here?

thank you for your help.

 

Proctor


 

       

 

           

 

 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>