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

RadComboBox RenderClientStateField Example

3 Answers 50 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 12 Apr 2013, 06:34 PM
HI there..

I cant seem to find an example on how to use RenderClientStateField method of the ComboBox to render the ClientStateField on a page.
Can someone please help me out.


Thanks,


3 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 15 Apr 2013, 04:19 PM
Hello Ronak,

I have already replied to your support ticket. In addition, I would like to ask you to continue our conversation in the other ticket, in order to keep the correspondence consistent.

Kind regards,
Nencho
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Magesh
Top achievements
Rank 1
answered on 01 Apr 2020, 11:25 AM

Hi,

Could you please share a link for Demo illustrating "Renderclientstatefield"  usefulness.

 

Thanks!

0
Peter Milchev
Telerik team
answered on 02 Apr 2020, 02:39 PM

Hello Magesh,

I am sharing the reply from the support thread with Ronak:

The mentioned function is an inherited one and we do not recommend any modifications. Here is the body of the functions and the implemented logic :

public virtual void RenderClientStateField(HtmlTextWriter writer)
       {
           writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientStateFieldID);
           writer.AddAttribute(HtmlTextWriterAttribute.Name, ClientStateFieldID);
           string clientState = SaveClientState();
           if (!string.IsNullOrEmpty(clientState))
           {
               writer.AddAttribute(HtmlTextWriterAttribute.Value, clientState);
           }
           writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden");
           writer.RenderBeginTag(HtmlTextWriterTag.Input);
           writer.RenderEndTag();
       }

 

With that said, this is not called explicitly and there are not demos about it. It is automatically called when creating any Telerik control inheriting the RadDataBoundControl. Its purpose is to create a hidden input, where useful information can be stored on the client, and then accessed on the server-side upon postback. 

Regards,
Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
ComboBox
Asked by
Ron
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Magesh
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or