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

How do telerik controls work ?

1 Answer 231 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jon Hobbs
Top achievements
Rank 1
Jon Hobbs asked on 17 Dec 2007, 01:18 PM
Hi,

Quite a general question this. I've been trying to learn a little more about how Telerik controls actually work in my applications as it's often been a source of confusion for me, particularly the way you guys seem to embed Javascript/css inside the controls.

So, when I place a Telerik control on the page (which I assume is an ASP.NET custom control) it basically creates a lot of HTML which I can see but a lot seems to be hidden.

For example, there seems to be a hidden input field called "ControlName_ClientState" , what is held in this? and is it possible to access client side variables without having to use client side methods ?

Also, if I don't supply a skin name the default skin seems to be embedded in the control too. Presumably this is why my source code contains lots of lines that look like this ......


<script src="/demos/aspnet/Prometheus/ScriptResource.axd?
d=XXX"
type="text/javascript"></script>


Sorry for all the newbie questions but I can't be the only person  on here that would benefit from a deeper understanding of what happens when I use telerik controls.

Jon


1 Answer, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 17 Dec 2007, 09:30 PM
Jon-

I am happy to see your eagerness to learn more about the controls. It's always a good idea to understand what's happening under the hood with your components.

In general, the RadControls for ASP.NET are "just" custom server controls, though very advanced and complex custom controls. If you Google "ASP.NET custom controls", you'll find tons of articles talking about how custom controls are built and that will go a long way to helping you understand the inner working on Telerik's controls.

The default skins and controls scripts are stored in the controls assemblies via a feature new to .NET 2 called "embedded web resources". This feature of the framework enables you to embed files in an assembly and then reference them via the syntax you noted (ScriptResource.axd). It makes it much easier to deploy a control because you need only copy one assembly vs an assembly and many JavaScript/CSS/images files.

Finally, when manipulating data on the client, it always best to use the control's client-side API vs. trying to hack the hidden "helper" fields yourself. The client-side APIs for all RadControls are very rich and enable you to do quite a bit without involving the server and they give you the benefit of keeping the control's state in sync with the server.

Hopefully that helps answer a few of your questions. Definitely start reading some articles online about custom control development to continue your learning and feel free to ask more questions if you have them.

-Todd
Tags
General Discussions
Asked by
Jon Hobbs
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Share this question
or