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

[Solved] ClientState Empty!

6 Answers 293 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sylvain
Top achievements
Rank 1
Sylvain asked on 23 Apr 2008, 03:11 PM
Hello!

I'm using a RadComboBox for ASP.NET AJAX.
I need to retrieve the value field in the Request.Form of the next page.
In order to do this, I did as told on this thred:
http://www.telerik.com/community/forums/thread/b311D-bcgmme.aspx

My problem is that the client state is filled only if the comboBox is openned by the user. If it isn't, the myCombobox_clientState stays empty.

Have an idea about this?

Thanks,

Sylvain.

6 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 28 Apr 2008, 07:08 AM
Hi Sylvain,

I suggest you execute the following javascript code after the RadComboBox definition.
<script type=text/javascript>  
 
function pageLoad()  
{  
  var combo=$find("RadComboBox1");  
  combo.set_text(combo.get_items().getItem(0).get_text());  
}  
 
<script> 

Regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sylvain
Top achievements
Rank 1
answered on 28 Apr 2008, 01:55 PM
Thanks for this.

I've tried it, but the combo var stays null regardless the id passed in '$find("")'.

I've read here: http://www.telerik.com/help/radcontrols/aspnet%2Dajax/
that I need to give the clientId.

I generate my DropDownList in the .cs file.Then I affect the pageLoad call to the OnClientLoad event.

Am I going wrong?
0
John
Top achievements
Rank 1
answered on 28 Apr 2008, 06:18 PM
Hi there:

I have the same trouble.

In prometheus and prior i have not trouble.

In radcontrols 2008 _clientstate will show nothing when i pass the combobox values to a different webpage (think on a combobox and a button with a postbackurl).

0
Nikolay
Telerik team
answered on 01 May 2008, 07:42 AM
Hello John,

You can use the approach described by Rosi, however, I suggest that you get the client-side combo instance, like:

var combo  = $find("<%= RadComboBox1.ClientID%>");

Also, you could use the Telerik.Web.UI.RadComboBox.ComboBoxes array. Telerik.Web.UI.RadComboBox.ComboBoxes can be used to obtain an array containing all the client-side combobox instances.

Hope this helps.

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sylvain
Top achievements
Rank 1
answered on 05 May 2008, 08:31 AM
Hello,

I've tried everything proposed here but nothing worked...
The $find never returns any object and the Telerik.Web.UI.RadComboBox doesn't exist. I can't find it while debugging. All I have is Telerik.Web.UI and other namespaces I actually don't really care.. :(
0
Nikolay
Telerik team
answered on 05 May 2008, 08:36 AM
Hello Sylvain,

Is it possible that you are running the classic RadComboBox version. If so, you should use the tlrkComboBoxes array to obtain an array containing all client-side combo objects.

Getting the client-side instance of a specific combo when it does not reside in another control is done like:

var combo = <%=RadComboBox1.ClientID %>;

If this does not help, could you please isolate the problem in a small and running project and attach the files to a new support thread to test them locally.

Sincerely yours,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Sylvain
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Sylvain
Top achievements
Rank 1
John
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or