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

RadInput ClientSide

1 Answer 219 Views
Input
This is a migrated thread and some comments may be shown as answers.
Bruno Lopes
Top achievements
Rank 1
Bruno Lopes asked on 21 Sep 2007, 02:46 AM
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

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 01 Oct 2007, 03:24 PM
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" /> 
</head> 
<body> 
    <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server"
            <Scripts> 
                <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"    /> 
            </Scripts> 
        </asp:ScriptManager> 
        <div> 
            <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%;"
                    <tr> 
                        <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="" /> 
                        </td> 
                    </tr> 
                </table> 
                <input id="RadTextBox1_ClientState" name="RadTextBox1_ClientState" type="hidden" /> 
            </div> 
        </div> 
         
        <script type="text/javascript"
        <!-- 
        Sys.Application.initialize(); 
        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")); 
        }); 
        // --> 
        </script>         
    </form> 
</body> 
</html> 
 

Please find attached an example


Best wishes,
Plamen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Input
Asked by
Bruno Lopes
Top achievements
Rank 1
Answers by
Missing User
Share this question
or