This is a migrated thread and some comments may be shown as answers.

setFocus not working

6 Answers 160 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Priya
Top achievements
Rank 1
Priya asked on 16 Apr 2009, 06:57 AM
hi
I have a radscriptmanager in masterpage..in contentpage i have a panel..inside that panel i placed a textbox.when i click on a button the panel is loaded.then the textbox in it should be get focused.i used the below code.but its not working
 Protected Sub tooltipAdd_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles tooltipAdd.Load  
        ' txtTitle.Focus()  
        Dim s As RadScriptManager  
         
        s = DirectCast(Me.Master.FindControl("RadAjaxManager1"), RadScriptManager)  
        s.SetFocus(txtTitle) 
thanks

6 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 16 Apr 2009, 03:22 PM
Hello Priya,

I can see that you are casting a control with ID "RadAjaxManager1" to RAdScriptManager. Can you confirm that this a ScriptManager or it is a RadAjaxManager control?

If your page is ajaxified with RadAjax, I suggest that you review this online demo for more information on how to set focus with RadAjax.

Check it out and let me know how it goes.

All the best,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Priya
Top achievements
Rank 1
answered on 17 Apr 2009, 08:20 AM
hi
 its RadScriptManager itself
thanks
0
Iana Tsolova
Telerik team
answered on 17 Apr 2009, 02:33 PM
Hello Priya,

I followed your scenario but was not able to replicate the issue. The RadScriptManager SetFocus() method works fine on my side. Please try the attached sample and let me know how it works on your end and what differs in your case.
Additionally, can you confirm the you have no RadAjax on the problematic page?

Regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Priya
Top achievements
Rank 1
answered on 20 Apr 2009, 07:54 AM
hi,
yes,i m using radajaxmanager in my page..

thanks alot....
0
Iana Tsolova
Telerik team
answered on 22 Apr 2009, 03:57 PM

Hello Priya,

In this case, where you have RadAjaxManager on the page, please try using the approach for focusing controls with RadAjax shown in the mentioned sample. Try using the RadAjax FocusControl() method:

RadAjaxManager1.FocusControl(txtTitle); 

Greetings,

Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Priya
Top achievements
Rank 1
answered on 23 Apr 2009, 05:15 AM
hi,
I tried that code too.
But not working
Thanks....
Tags
Ajax
Asked by
Priya
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Priya
Top achievements
Rank 1
Share this question
or