Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sonja 133 posts 621 karma points
    Oct 08, 2018 @ 07:29
    Sonja
    0

    The name 'UmbClientMgr' does not exist in the current context

    Hi,

    I have this code in the partial view:

       <button class="stackedContent default" href="@item.Url" title="@item.Title" id="TestBtn" onclick="@UmbClientMgr.openModalWindow("mypage.aspx", "some title", true, 800, 600);">
    

    and I'm getting error Compiler Error Message: CS0103: The name 'UmbClientMgr' does not exist in the current context

    In the master page in the head I have the following links:

     <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
        <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
        <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <script type="text/javascript" src="umbraco_client/Application/NamespaceManager.js"></script>
    <script type="text/javascript" src="umbraco_client/Application/UmbracoApplicationActions.js"></script>
    <script type="text/javascript" src="umbraco_client/Application/UmbracoUtils.js"></script>
    <script type="text/javascript" src="umbraco_client/Application/HistoryManager.js"></script>
    <script type="text/javascript" src="umbraco_client/Application/UmbracoClientManager.js"></script>
    

    and before the end of the body i have the following scripts:

    <script src="https://code.jquery.com/jquery-3.3.1.min.js"  crossorigin="anonymous"></script>
    
        <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"></script>
        <script src="https://ajax.aspnetcdn.com/ajax/mvc/5.2.3/jquery.validate.unobtrusive.min.js"></script>
        <script src=" ~/scripts/script.js"></script>
    

    Am I missing some reference?

    Please advise how do I make my code work

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Oct 08, 2018 @ 11:48
    Dave Woestenborghs
    0

    Hi Sonja,

    Are you trying to use this code on the front end of your website ?

    Dave

  • Sonja 133 posts 621 karma points
    Oct 08, 2018 @ 11:53
    Sonja
    0

    Hi Dave,

    Yes all this code is on the front end, in the master page and in the partial view

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Oct 08, 2018 @ 11:59
    Dave Woestenborghs
    0

    Hi Sonja,

    The problem is that the code you are using depends on the backoffice.

    All of these scripts are meant for the backoffice :

    <script type="text/javascript" src="umbraco_client/Application/NamespaceManager.js"></script>
    <script type="text/javascript" src="umbraco_client/Application/UmbracoApplicationActions.js"></script>
    <script type="text/javascript" src="umbraco_client/Application/UmbracoUtils.js"></script>
    <script type="text/javascript" src="umbraco_client/Application/HistoryManager.js"></script>
    <script type="text/javascript" src="umbraco_client/Application/UmbracoClientManager.js"></script>
    

    So they will not work in your front end.

    Maybe you can explain what you are trying to achieve and we can find a solution for that.

    Dave

  • Sonja 133 posts 621 karma points
    Oct 08, 2018 @ 12:01
    Sonja
    0

    I'm trying to do a modal popup that will load url

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Oct 08, 2018 @ 12:33
    Dave Woestenborghs
    0

    hi Sonja,

    I think you need a plugin for that.

    But I don't know what you are using for client side scripting.

    If you are using jQuery a google search on jQuery Modal will give you enough examples/plugins to get this done.

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft