Home / Community & Support / Knowledge Base / RadControls for ASP.NET and ASP.NET AJAX / ComboBox / Maintaining RadComboBox Value at the client for an easier access through Request.Form at the server

Maintaining RadComboBox Value at the client for an easier access through Request.Form at the server

Article Info

Rating: 4

Article information

Article relates to

 RadComboBox for ASP.NET AJAX

 (Telerik.Web.UI v2008.1.415)

Created by

 Simon, Telerik

Last modified by

 Veskoni, Telerik


HOW-TO
Maintain the Value of a RadComboBox at the client, so that it can be accessed easier at the server through the Request.Form collection.

DESCRIPTION
RadComboBox for ASP.NET AJAX stores its whole Client State at the client in a hidden field named "RadComboBoxID_ClientState". There, all needed information about the state of the control is stored in a specifically formatted string. Retrieving the Value, for example, of the RadComboBox on the server through the Request.Form collection requires parsing of this string, which in some cases may not be desired - the code is long or the page to which we POST does not know how to parse it.

In such cases, we need to store the Value in a more simple and standard way. Having in mind how ASP.NET stores the Values for the classic web controls, we can do the same thing with RadComboBox. We simply put a hidden field on the page named "RadComboBoxID_Value" and set its value to the Value of the RadComboBox whenever it is changed. This can be done either at the server or at the client. Further, at the server, we can retrieve the Value in the standard way by getting: Request.Form["RadComboBoxID_Value"] in C# and Request.Form("RadComboBoxID_Value") in VB.

Attached is a project illustrating an implementation of the approach.

Comments

  • Rajeev , May 14, 2008

    i am added a radcombo in a usercontrol and added in the masterpage. I am getting null value while i tried the above code.

  • Telerik Admin , May 30, 2008

    I uploaded the modified project and now it will work with user control and master page.

If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.