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

Add JS function from C#

2 Answers 34 Views
TileList
This is a migrated thread and some comments may be shown as answers.
Maxime
Top achievements
Rank 1
Maxime asked on 03 Jul 2013, 03:38 PM
Hi everybody,

I would like to know if it is possible to set a JS function of a tileList in code-behind (SelectionStateChanged), and how.
I have already created a JS function that i want to be launched when the tile is selected.

I try to create every tileList i need from code-behind, that is why i need this.

Many thanks !

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 04 Jul 2013, 12:19 PM
Hi Maxime,

If you already have the desired function on the page you can point the OnClientTileSelected or OnClientTileSelecting property of the RadTileList to the desired event handler's name. The list with the properties that pass the client-side event handlers is available here: http://www.telerik.com/help/aspnet-ajax/tilelist-server-side-tilelist-object.html.
Here is a small example

in the code-behind
RadTileList tl = new RadTileList();
tl.OnClientTileSelected = "myHandler";
while the function is declared in the markup or is in a JS file that is referenced by the page:
function myHandler(sender, args)
{
 
}



Regards,
Marin Bratanov
Telerik
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 the blog feed now.
0
Maxime
Top achievements
Rank 1
answered on 05 Jul 2013, 08:47 AM
Hi,

Many thanks for the advice, it works :)

Regards,
Maxime.
Tags
TileList
Asked by
Maxime
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Maxime
Top achievements
Rank 1
Share this question
or