View Full Version : Focus on a control in collapsable pannel.

Narasimha Rao K
05-30-2012, 12:18 PM
Hello frends,

"How to focus on a control which is in collapsable pannel while expand. Collapsable pannel is in Ajax Tab container."

Please Answer me.

05-30-2012, 12:48 PM
absolutely need more information than that- I am guessing since you said AJAX and talking about aspx that you are using the ASP.NET AJAX tool kit released by MSDN? if so what control is that you are using? do you have the script controls dropped in to handle it? What control are you trying to focus on?

I can give a vague answer (but without more information no direct one)...
Any control you have that get popped up on the screen can be targeted post rendering by targeting its <asp ID="" property. Sometimes that object will have an ID that looks like id=<%@WhatYouNamedIt%>... I tried to find a good example but failed to find one- and it's been a while since I've done targeting of rendered controls.
But, what I am getting at is "what you think" its id is may be completely different than what it gets rendered as. You need to view the source and find the ID you are trying to target. You then need to find out how the AJAX you are using is 'supposed' to target that control.

This is a good resource ASP.NET Control Identification (http://msdn.microsoft.com/en-us/library/1d04y8ss.aspx)
As is this if you are doing the MSDN AJAX Toolkit codeplex main (http://ajaxcontroltoolkit.codeplex.com/)
example site (http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AsyncFileUpload/AsyncFileUpload.aspx)
tutorials (http://www.asp.net/web-forms/tutorials/ajax-control-toolkit)

again- without more info impossible to help more than that

Edit: Before posting back "I am using control so-and-so" please try to figure it out from the resources I provided and post back with help- I usually do not just flop the answer; I will help guide you but this is a learning forum and not doing it will only hurt you. Guidance is always offered- we need to see code you have worked on.

Narasimha Rao K
05-30-2012, 12:58 PM
dear frend,
Thank you for respond,

"How to focus on a asp control which is in Ajax collapsable pannel while expand. Collapsable pannel is in Ajax Tab container."

05-30-2012, 01:56 PM
ok- find a translator to read my post.

Narasimha Rao K
05-31-2012, 08:17 AM
Thank you for respond

iam using the ASP.NET AJAX tool kit released by MSDN,
using Ajax collapsable Pannel And Ajax Tabcontainer.

I am using Text Box trying to focus on.

I have No script controls dropped in to handle it.

05-31-2012, 01:50 PM
there are no quick answers to this- there are no methods or properties that I saw for the AJAX controls or the webform objects.

What you need to do is realize the following. The Panel you will be targeting is a child object of the Tab Control you are using. What you will need to do is multi-step.

First determine what you panel 'looks like' prost rendering, but collapsed. My guess is that it will just have CSS property of display:none; That means it is there, you just cannot see it. You then need to see what it looks like when it is expanded. All of this should be real quick, either inspect element/view source.

Then the harder part. You need to add a Javascript listener or an event of 'some kind' to trigger once the panel expands. I don't mess with javascript too much so no idea how to do so- I cannot imagine though that it is impossible.

You need to have that function basically target the correct panel once the parent panel is displayed. You may find more help in the Javascript section when you get to this part. I would leave this thread here; find out all the asp.net 'stuff' you need to know, and then most likely transfer this thread to the javascript forum.


I have No script controls dropped in to handle it.

How do you expect any AJAX control to work if you have no script handle controls in place?