Telerik Telerik
The Telerik Blogs
  • Isolating a problem in a sample project

    Wednesday, September 29, 2010 by Support Dept | Comments 1
    “Please send us a sample project”
    If you have contacted Telerik’s support before, chances are that you have been asked to send us a sample project. In our daily routine, we try to avoid requesting such as much as possible, but there are cases in which we simply cannot move forward without a project that would allow us to reproduce a specific problem locally. We usually ask for isolated sample only after:
    • we have failed to reproduce the reported problem by following your instructions
    • we have failed to reproduce the reported problem by running the code provided
    • we have failed ...
  • Executing JavaScript function from server-side code

    Tuesday, May 05, 2009 by Support Dept | Comments 10

    This is a pretty common scenario when working with WebForms. There are many ways to achieve the desired result, but they have one thing in common – you should make sure that the controls are fully loaded in the page before trying to get a reference to them and use them in your JavaScript code.

    In ASP.NET it is pretty straightforward to do that. For example you could use a label:
    ASPX
    <head runat="server">
       
    <title>Untitled Page</title>
       
    <script type="text/javascript">
       
    function calledFn()
       
    {
           
    alert("code ...

  • XML Syntax Rules

    Friday, April 03, 2009 by Support Dept | Comments 0

    All XML Elements Must Have a Closing Tag

    In HTML, you will often see elements that don't have a closing tag: 

    <p>This is a paragraph 
    <p>This is another paragraph 
     

    In XML, it is illegal to omit the closing tag. All elements must have a closing tag:
    <p>This is a paragraph</p> 
    <p>This is another paragraph</p>  
     

     

     Note: You might have noticed from the previous example that the XML declaration did not have a closing tag. This is not an error. The declaration is not a part of the XML ...

  • XML DataSource - General information

    Thursday, March 26, 2009 by Support Dept | Comments 0

    The XmlDataSource control is a data source control that presents XML data to data-bound controls. The XmlDataSource control can be used by data-bound controls to display both hierarchical and tabular data. The XmlDataSource control is typically used to display hierarchical XML data in read-only scenarios. Because the XmlDataSource control extends the HierarchicalDataSourceControl class, it works with hierarchical data. The XmlDataSource control also implements the IDataSource interface and works with tabular, or list-style, data. 

    Page developers use the XmlDataSource control to display XML data using data-bound controls.

    The XmlDataSource typically loads XML data from an XML file, which is specified by ...

  • JavaScript - Variables and Types Basics

    Tuesday, March 24, 2009 by Support Dept | Comments 0

    This article is taken from JavaScript @ Wikibooks.

    JavaScript is a loosely typed language, this means that you don’t have to worry about setting the type of variable and you can change at will in runtime. But when you code, you have to make sure that you are getting the right type at the right time.

    Variable declaration

    Variables are commonly explicitly declared the var statement, as shown below:

    var c;
  • Client - side events in JavaScript

    Friday, February 27, 2009 by Support Dept | Comments 0

    Below is a table of the most common client side events in JavaScript. The Table is divided into three columns – the first lists the name of the event. The second contains a short description of the event, and the third lists all page objects, which support the given event.                                         

    Event Name                Description  Supported by objects

     onabort

    The onabort event occurs when loading of an image is aborted.

    image

    onblur

    The onblur event occurs when an object loses focus.

    button, checkbox, fileUpload, layer, frame, password, radio, reset, submit, text, textarea, window

    onchange

    The onchange event occurs when the content ...

  • Hiding JavaScript code from old browsers

    Friday, February 13, 2009 by Support Dept | Comments 0

    Sometimes we need to hide the JavaScript code from the old browsers that do not support it.

    To prevent old browsers from displaying your JS code, do the following:

     

    Immediately after the opening <script> tag, put a one-line HTML-style comment without the closing characters, so that the first two lines of your script would look like this:

    <script language="JavaScript">
    <!--
      
    At the end of your script, put the following two lines:
    //-->
    </script>
      

    Thus, your HTML file will contain the following fragment:

    <script language="JavaScript">
    <!--

        Put your JS code here. Old

        browsers will treat it as regular

        ...

  • Chainability (The Magic of jQuery)

    Friday, February 06, 2009 by Support Dept | Comments 0

    This article is taken from How jQuery Works.

     

    jQuery uses an interesting concept called a "Builder" to make its code short and simple. The Builder pattern is an object-oriented programming design pattern that has been gaining popularity.

    In a nutshell: Every method within jQuery returns the query object itself, allowing you to 'chain' upon it, for example:

    $("a")
       .filter(".clickme")
         .click(function(){
           alert("You are now leaving the site.");
         })
       .end()
       .filter(".hideme")
         .click(function(){
           $(this).hide();
            return  false;
         })
       .end();
     

    Which would work against the following HTML: ...

  • JavaScript Timing Events

    Friday, January 30, 2009 by Support Dept | Comments 0

    This article is taken from W3Schools.

     

    With JavaScript, it is possible to execute some code NOT immediately after a function is called, but after a specified time interval. This is called timing events.

    It's very easy to time events in JavaScript. The two key methods that are used are:

    • setTimeout() - executes a code some time in the future
    • clearTimeout() - cancels the setTimeout()

    setTimeout()
    Syntax

    var t=setTimeout("javascript statement",milliseconds); 

    The setTimeout() method returns a value - In the statement above, the value is stored in a variable called t. If you want to cancel this setTimeout(), ...

  • Encode and Decode strings using JavaScript

    Thursday, January 15, 2009 by Support Dept | Comments 0

    In order for a string to be read from all computers sometimes it is useful to encode and decode it. This can be easily achieved using the JavaScript built-in escape() and unescape() methods. Both the escape() and the unescape() methods have the same argument – the string which will be escaped or unescaped.

    The escape() method returns a string value (in Unicode format) that represents the encoded contents of the function argument. All spaces, punctuation, accented characters, and any other non-ASCII characters are replaced with %xx encoding, where xx is equivalent to the hexadecimal number representing the character.

    For example, ...

  1. 1
  2. 2
  3. »