Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > [Upload] ScriptRegistrar & scripts in other folder than 'Scripts'

Not answered [Upload] ScriptRegistrar & scripts in other folder than 'Scripts'

Feed from this thread
  • ANTONIN avatar

    Posted on Jun 21, 2012 (permalink)

    Hi there,

    I'm new in telerik world and I'm trying to use Telerik Upload in my MVC3 website (razor mode). My problem is that I'd like to place telerik scripts in another folder than default one (e.g. "Scripts").

    Here is the code of my view :

    @using Telerik.Web.Mvc.UI;
    @{
        ViewBag.Title = "Index";
        Layout = "~/Views/Shared/_Layout.cshtml";
     
    }
     
    @Html.Telerik().ScriptRegistrar()
     
    @Html.Telerik().Upload().Name("attachments") .Multiple(false) .Async(async => async .Save("Save", "Upload").Remove("Remove", "Upload").AutoUpload(true))
     
    <p class="note">
        Maximum allowed file size: 10 MB
    </p>

    I added js reference in my _layout.cshtml :

    <head>
    ...
    <script type="text/javascript" src="/Assets/js/libs/telerik/telerik.upload.min.js"></script>
    ...
    </head>

    As you can see telerik scripts are placed in "/Assets/js/libs/telerik/" folder. jquery script is placed in "/Assets/js/libs/" folder.

    In this configuration when I try to upload something, I receive the following error :
    FileNotFoundException : Specified file does not exist: "~/Scripts/jquery-1.7.1.js".

    I suppose I have to complete the ScriptRegistrar method in order to do not use the default folder but I didn't find how to do it in the documentation. Maybe I missed something.

    Your help would be greatly appreciated.

    Thanks.

    EDIT : sorry I just saw that there was a specific forum for upload purpose :s

    Reply

  • ANTONIN avatar

    Posted on Jun 21, 2012 (permalink)

    Hi,

    Finally, I found what I was looking for.

    Here is the line :

    @Html.Telerik().ScriptRegistrar().jQuery(false).DefaultGroup(group => group.DefaultPath("~/Assets/js/libs/telerik"))

    You can mark this answer as correct in case someone would have the same problem as me.
    Thanks

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > [Upload] ScriptRegistrar & scripts in other folder than 'Scripts'