Wednesday, June 11, 2014

Convert Textbox in the Custom Language Transliteration in ASP.Net

Create on sample we page and write this code below


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LanguageTextBox.aspx.cs"
    Inherits="SampleTestingCodes.LanguageTextBox" ClientIDMode="Static" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
        google.load("elements", "1", {
            packages: "transliteration"
        });
        var control = null;
        function GetConvertText() {
            var options = {
                sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
                destinationLanguage: [google.elements.transliteration.LanguageCode.TELUGU],
                shortcutKey: 'ctrl+g',
                transliterationEnabled: true
            };
            // Create an instance on TransliterationControl with the required options.
            control = new google.elements.transliteration.TransliterationControl(options);
            control.makeTransliteratable(['TextBox1']);
        }
       
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    </div>
    <asp:TextBox ID="TextBox1" runat="server" onKeyup="GetConvertText();"></asp:TextBox>
    </form>
</body>
</html>




Happy coding  JJJJJJJJJJJJJJJJJJJJJJJ

No comments:

Post a Comment