Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

TagCloud / Generating TagCloud from External Sources

Generate From URL

Generate From File

Generate From Text

Configure Example
Combine Sources
Combine the external sources into the same TagCloud
WordsToExclude
Add words to be excluded from the text separated by commas (,)
PunctuationCharacters
Set the characters that should be considered as punctuations



  • RadTagCloud provides an easy way to generate tags from external sources. By setting the corresponding property, you can generate tags from text file, direct input (text) and from a web site. In the example above, use the first input field to set absolute URL to generate tags from a web site, use upload section to provide a text file as a source, use the text area to set text as a source.

    To configure RadTagCloud to use external sources you need to set one or more of the following properties:
    • Text - sets text value for direct input generation source
    • TextFile - specifies the location of the file to be used as a generation source
    • TextUrl - specifies the URL of the web site to be used as a generation source

    If more than one of these properties are set RadTagCloud will combine the sources when generating the tags.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" AutoEventWireup="true" Inherits="Telerik.Web.Examples.TagCloud.ExternalSources.DefaultCS"
        CodeFile="DefaultCS.aspx.cs" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!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></title>
        <qsf:HeadTag ID="Headtag1" runat="server" />
        <style type="text/css">
            .itemWrapper
            {
                padding: 10px;
                margin-bottom: 15px;
                background-color: #ddd;
                border: 5px solid #e5e5e5;
                color: #010101;
            }
            .itemTitle
            {
                line-height: 12px;
                font-weight: bold;
                text-align: left;
            }
            .propertyRow
            {
                margin-bottom: 5px;
            }
            .propertyName
            {
                margin-bottom: 5px;
            }
            .propDescription
            {
             font-size: 0.8em;
             color: #666;
            }
            .fieldRow label
            {
             float: left;
             line-height: 22px;
            }
            .ruFakeInput
            {
             width: 218px;
            }
        </style>
    </head>
    <body class="BODY">
        <form id="Form2" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" ShowSkinChooser="false" />
        <telerik:RadScriptManager ID="ScriptManager" runat="server" />
        <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="All" />
        <telerik:RadAjaxLoadingPanel ID="ajaxLoadingPanel1" runat="server" ></telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="ajaxLoadingPanel1">
            <div style="width: 350px; float: left;">
                <div class="itemWrapper">
                    <div class="itemTitle">
                        Generate From URL</div>
                    <hr />
                    <div class="fieldRow">
                        <label>URL:&nbsp;</label>
                        <asp:TextBox ID="urlField" runat="server" TextMode="SingleLine" Width="285px" Style="margin-bottom: 5px;" ToolTip="The URL must start with http://"></asp:TextBox>
    <asp:RegularExpressionValidator ID="urlValidator" runat="server" SetFocusOnError="true" ErrorMessage="Valid URL should start with http://"
    ControlToValidate="urlField" ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?"></asp:RegularExpressionValidator>

                    </div>
                    <div class="fieldRow" style="text-align: right;">
                        <asp:Button ID="urlButton" runat="server" Text="Generate" OnClick="urlButton_Click" />
                    </div>
                </div>
                <div class="itemWrapper">
                    <div class="itemTitle">
                        Generate From File</div>
                    <hr />
                    <div class="fieldRow">
                        <label>File:&nbsp;</label>
                    <telerik:RadAsyncUpload ID="fileField" runat="server" AllowedFileExtensions="txt"
                        TargetFolder="~/TagCloud/Examples/ExternalSources/Files">
                    </telerik:RadAsyncUpload>
                    </div>
                    <div class="fieldRow" style="text-align: right;">
                        <asp:Button ID="fileButton" runat="server" Text="Generate" OnClick="fileButton_Click" />
                    </div>
                </div>
                <div class="itemWrapper">
                    <div class="itemTitle">
                        Generate From Text</div>
                    <hr />
    <asp:TextBox ID="directInputField" runat="server" TextMode="MultiLine" Width="315px"
    Height="250px" Style="margin-bottom: 5px;"></asp:TextBox>

                    <div class="fieldRow" style="text-align: right;">
                        <asp:Button ID="directInputButton" runat="server" Text="Generate" OnClick="directInputButton_Click" />
                    </div>
                </div>
            </div>
            <div style="width: 450px; float: right;">
                <telerik:RadTagCloud ID="RadTagCloud1" runat="server" MaxNumberOfItems="30" TakeTopWeightedItems="true"
                    PunctuationCharactersValid=".'#$£€<>" Width="200px" style="float: left;">
                </telerik:RadTagCloud>
                <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Configure Example"
                    Expanded="true" Width="200px" style="float:right;">
                    <div id="configurationPanel" class="configurationPanel">
                        <div class="propertyRow">
                            <div class="propertyName">
                                <strong>Combine Sources</strong>
                                <div class="propDescription">Combine the external sources into the same TagCloud</div>
                            </div>
                            <div>
                                <asp:RadioButtonList ID="combineSources" runat="server">
                                    <asp:ListItem Text="Yes" Value="1" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="No" Value="0"></asp:ListItem>
                                </asp:RadioButtonList>
                            </div>
                        </div>
                        <div class="propertyRow">
                            <div class="propertyName">
                                <strong>WordsToExclude</strong><br />
                                <div class="propDescription">Add words to be excluded from the text separated by commas (,)</div>
                            </div>
                            <div>
                                <asp:TextBox ID="wordsToExclude" TextMode="SingleLine" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="propertyRow">
                            <div class="propertyName">
                                <strong>PunctuationCharacters</strong><br />
                                <div class="propDescription">Set the characters that should be considered as punctuations</div>
                            </div>
                            <div>
                                <asp:TextBox ID="punctCharacters" TextMode="SingleLine" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="propertyRow">
                            <div>
                                <asp:Button ID="updateButton" Text=" Update " runat="server" OnClick="updateButton_Click" />
                            </div>
                        </div>
                    </div>
                </qsf:ConfiguratorPanel>
                <br style="clear:both; line-height:1px;" />
            </div>
            <br style="line-height: 1px; clear: both;" />
        </telerik:RadAjaxPanel>

        <qsf:Footer runat="server" ID="Footer1" ShowCodeViewer="true" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451