none
Web api not loaded in partial view after rendering the code in MVC in C# RRS feed

  • Question

  •    

    <div>
        <table>
            <tr>
                <td colspan="2" align="center" valign="middle" class="bright bbottom">Local General<br>Recommendations</td>
                <td colspan="7" class="bbottom">
                    @Html.TextBoxFor(model => model.LocalGeneralRecommendations, new { @class = "textwidth3", maxlength = "99", @id = "LocalGeneralRecommendations" })
                </td>
            </tr>
        </table>

    </div>                        


    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script src="~/Scripts/transliteration.I.js"> </script>

    <script type="text/javascript">
        google.load("elements", "1", {
            packages: "transliteration"
        });

        function onLoad() {
            debugger;
            var session = 6
            var lan = '';
            if (session != null && session != "") {
                switch (parseInt(session)) {
                    case 2:
                        lan = 1
                        break;
                    case 5:
                        lan = 2
                        break;
                    case 6:
                        lan = 3
                        break;                 
                    case 99:
                        lan = 0
                        break;

                }
            }

            var language = [
               google.elements.transliteration.LanguageCode.ENGLISH,
               google.elements.transliteration.LanguageCode.BENGALI,
               google.elements.transliteration.LanguageCode.GUJARATI,
               google.elements.transliteration.LanguageCode.HINDI,
               google.elements.transliteration.LanguageCode.KANNADA,
               google.elements.transliteration.LanguageCode.MALAYALAM,
               google.elements.transliteration.LanguageCode.MARATHI,
               google.elements.transliteration.LanguageCode.NEPALI,
               google.elements.transliteration.LanguageCode.ORIYA,
               google.elements.transliteration.LanguageCode.PUNJABI,
               google.elements.transliteration.LanguageCode.SANSKRIT,
               google.elements.transliteration.LanguageCode.SINHALESE,
               google.elements.transliteration.LanguageCode.TAMIL,
               google.elements.transliteration.LanguageCode.TELUGU,
               google.elements.transliteration.LanguageCode.URDU]

            var options = {
                sourceLanguage:
                google.elements.transliteration.LanguageCode.ENGLISH,
                destinationLanguage:
                language[lan],
                shortcutKey: 'ctrl+e',
                transliterationEnabled: true
            };
            if (lan != '') {
                var control =
                    new google.elements.transliteration.TransliterationControl(options);
                var ids = ["LocalGeneralRecommendations"];
                control.makeTransliteratable(ids);
            }

        }
        google.setOnLoadCallback(onLoad);
    </script>

    Error :

    Uncaught TypeError: google.load is not a function
        at eval (eval at <anonymous> (jquery_min.js:2), <anonymous>:2:12)
        at eval (<anonymous>)


    Wednesday, June 12, 2019 7:10 AM

All replies

  • ASP.NET MVC issues can be discussed at the ASP.NET forums.

    http://forums.asp.net/

    • Proposed as answer by Guido Franzke Monday, June 17, 2019 6:50 AM
    Wednesday, June 12, 2019 7:21 AM
  • Hi Anil,

    Thank you for posting here.

    Since this thread is related to asp.net, you could post it in the following forum.

    https://forums.asp.net/

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 12, 2019 7:59 AM