Wednesday 17 April 2013

Hindi Textbox [Multilingual Infact] Using Google Transliteration in ASP.Net

Hindi Textbox [Multilingual Infact] Using Google Transliteration in ASP.Net

Today I am going to show you how to create a textbox which will take input in any language using Google Transliteration API... This is how we can do this:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Transliterate.aspx.cs" Inherits="Transliterate" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

    <html xmlns="">
    <head id="Head1" runat="server">
    <script src="" type="text/javascript">
    <script type="text/javascript" language="javascript">
    google.load("elements", "1", {
    packages: "transliteration"
    function onLoad() {
    var options = {
    sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
    destinationLanguage: [google.elements.transliteration.LanguageCode.HINDI],
    shortcutKey: 'ctrl+g',
    transliterationEnabled: true
    var control = new google.elements.transliteration.TransliterationControl(options);
    //TEXT1 is the id of the control which you will use for the transliteration.
    <body >
    <form id="form2" runat="server">
    <div class="Google-transliterate-Way2blogging">
        <asp:TextBox ID="TextBox1" TextMode="MultiLine" Width="600" Height="200" runat="server"></asp:TextBox>


  1. it works very nice sir.... thanks

  2. really good post.but i need this transliteration for multiple text boxes .I will enter in one text box the transliteration should come on another text box.I searched on google i got only for one text box but i need multiple text boxes.
    Please if possible for you than please post that code.

  3. Hi Sayyed, For Multiple textboxes you need to pass the name of the various textbox controls for which you need to implement transliteration like as shown below:

    var control = new google.elements.transliteration.TransliterationControl(options);

    Where Textbox1 and Textbox2 are two controls in the same form. Thanks


Thank You for Your Comments. We will get back to you soon.

back to top