get chosen value from Client template back to server

1 Answer 25 Views
SearchBox
Fit2Page
Top achievements
Rank 1
Iron
Veteran
Iron
Fit2Page asked on 23 Jun 2021, 10:12 AM

Hi,

 

How could one get the selected value from a radsearchbox client template back to the server code?

Is there any other method than sending it in a url querystring?

 

Thanks, Marc

 

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 28 Jun 2021, 08:44 AM

Hi Marc,

Depending on whether you are trying to send selected values (assuming selection from your description) or the search context of the component, the implementation may vary.

In the case of search context, you can use AJAX for sending data to the server. For instance, using the OnClientSearch you can get the context you're searching for, then call the ajaxRequest(arguments) method of RadAjaxManager to send the data to the server. You can also pass more arguments to this method as we have instructed here: Pass More than one Argument

Here is an example of utilizing the ClientSearch event: Client-side Templates

You can also set the values to a hidden field using the OnClientSearch event. Those will be accessible on the server during a PostBack.

Regards,
Attila Antal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Fit2Page
Top achievements
Rank 1
Iron
Veteran
Iron
commented on 28 Jun 2021, 11:45 AM

Thanks Attila, this got me going
Tags
SearchBox
Asked by
Fit2Page
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Attila Antal
Telerik team
Share this question
or