This is a migrated thread and some comments may be shown as answers.

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

1 Answer 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ANTONIN
Top achievements
Rank 1
ANTONIN asked on 21 Jun 2012, 10:05 AM
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

1 Answer, 1 is accepted

Sort by
0
ANTONIN
Top achievements
Rank 1
answered on 21 Jun 2012, 11:34 AM
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
Tags
General Discussions
Asked by
ANTONIN
Top achievements
Rank 1
Answers by
ANTONIN
Top achievements
Rank 1
Share this question
or