RadInput ClientSide

2 posts, 0 answers
  1. Bruno Lopes
    Bruno Lopes avatar
    13 posts
    Member since:
    Mar 2007

    Posted 20 Sep 2007 Link to this post

    Hi there,

    how can I create a RadInput NumericBox at the client side using Ajax shortcut $create and attach it to an existing div?

    Thanks in advance
  2. Plamen Peshev
    Plamen Peshev avatar
    886 posts

    Posted 01 Oct 2007 Link to this post

    Hi Ricardo,

    You can include a JavaScript file on a Web page by registering it through a ScriptReference object. You can register a script file that is located on the Web site or a script file that is embedded as a resource in an assembly. After registering the script file, you can use its functions on the Web page.

    Here is an example:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title>Untitled Page</title> 
        <link href="Default/styles.css" rel="stylesheet" type="text/css" /> 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="ScriptManager1" runat="server"
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Toolkit.BaseScripts.js"    /> 
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.CommonMergedScripts.js"    /> 
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Toolkit.CommonScripts.js"    /> 
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Input.TextBox.RadInputScript.js"    /> 
                <div id="RadTextBox1_wrapper" class="radInput_Default" style="display: inline; zoom: 1; 
                    width: 100px; height: 20px;"> 
                    <table cellpadding="0" cellspacing="0" border="0" style="table-layout: fixed; width: 100%;"
                            <td class="inputCell" style="width: 100%; height: 100%;"
                                <input type="text" size="15" id="RadTextBox1_text" style="width: 100%;" /> 
                                <input style="visibility: hidden; position: absolute; right: 0; width: 0; height: 0; 
                                    overflow: hidden; border: 0; padding: 0; margin: 0;" id="RadTextBox1" name="RadTextBox1" 
                                    type="text" value="" /> 
                    <input id="RadTextBox1_ClientState" name="RadTextBox1_ClientState" type="hidden" /> 
            <script type="text/javascript"
            Sys.Application.add_init(function() { 
                $create(Telerik.Web.UI.RadTextBox, {"ClientStateFieldID":"RadTextBox1_ClientState","Enabled":true,"Styles":{HoveredStyle: ["height:20px;width:125px;", "radHoverCss_Default"],InvalidStyle: ["height:20px;width:125px;", "radInvalidCss_Default"],DisabledStyle: ["height:20px;width:125px;", "radDisabledCss_Default"],FocusedStyle: ["height:20px;width:125px;", "radFocusedCss_Default"],EmptyMessageStyle: ["height:20px;width:125px;", "radEmptyMessageCss_Default"],EnabledStyle: ["height:20px;width:125px;", "radEnabledCss_Default"]}}, null, null, $get("RadTextBox1")); 
            // --> 

    Please find attached an example

    Best wishes,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top