Click here to Skip to main content
15,347,625 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to distribute the processing load of one system on several systems؟ Pin
Richard Deeming24-Jan-21 23:45
mveRichard Deeming24-Jan-21 23:45 
GeneralRe: How to distribute the processing load of one system on several systems؟ Pin
Nelek25-Jan-21 3:00
protectorNelek25-Jan-21 3:00 
QuestionProblem with jQuery and autocomplete Pin
Member 1299665513-Jan-21 4:35
MemberMember 1299665513-Jan-21 4:35 
AnswerRe: Problem with jQuery and autocomplete Pin
Richard Deeming13-Jan-21 4:47
mveRichard Deeming13-Jan-21 4:47 
GeneralRe: Problem with jQuery and autocomplete Pin
Member 1299665513-Jan-21 4:56
MemberMember 1299665513-Jan-21 4:56 
GeneralRe: Problem with jQuery and autocomplete Pin
Richard Deeming13-Jan-21 5:09
mveRichard Deeming13-Jan-21 5:09 
GeneralRe: Problem with jQuery and autocomplete Pin
Member 1299665513-Jan-21 5:23
MemberMember 1299665513-Jan-21 5:23 
GeneralRe: Problem with jQuery and autocomplete Pin
Richard Deeming13-Jan-21 6:20
mveRichard Deeming13-Jan-21 6:20 
Well, it does matter which approach you use - the @Scripts.Render approach won't work in ASP.NET Core / .NET 5, and the asp-append-version approach won't work properly in MVC5. Smile | :)

(To be precise, the asp-* attributes will be sent as-is in the rendered HTML, and won't have the expected effect in MVC5.)

If you're using MVC5, stick to the @Scripts.Render approach for your bundles, and remove the asp-* attributes from your <script> tags:

Layout:
Razor
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
<script src="~/js/site.min.js"></script>
@RenderSection("scripts", required: false)
View:
Razor
@section scripts {
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/jquery-ui.min.js"></script>
    <link href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css" rel="stylesheet" />
    <script src="~/Scripts/selectAuthor.js"></script>
}


If you're using ASP.NET Core or .NET 5, use the asp-* attributes instead:

Layout:
Razor
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js"
        asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
        asp-fallback-test="window.jQuery"
        crossorigin="anonymous"
        integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"
        asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
        asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
        crossorigin="anonymous"
        integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa">
</script>
<script src="~/js/site.min.js" asp-append-version="true"></script>
@RenderSection("scripts", required: false)
View:
Razor
@section scripts {
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/jquery-ui.min.js"></script>
    <link href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css" rel="stylesheet" />
    <script src="~/Scripts/selectAuthor.js" asp-append-version="true"></script>
}


Either way, make sure you only include each library once in the page, and that you include them in the correct order. Check the "view source" option in your browser to view the rendered output to make sure it's doing what you expect.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Problem with jQuery and autocomplete Pin
Member 1299665513-Jan-21 6:21
MemberMember 1299665513-Jan-21 6:21 
GeneralRe: Problem with jQuery and autocomplete Pin
Member 1299665513-Jan-21 7:01
MemberMember 1299665513-Jan-21 7:01 
GeneralRe: Problem with jQuery and autocomplete Pin
Richard Deeming13-Jan-21 22:14
mveRichard Deeming13-Jan-21 22:14 
QuestionI have created housie game page, but it is loading slow. Pin
Member 150388166-Jan-21 0:04
MemberMember 150388166-Jan-21 0:04 
AnswerRe: I have created housie game page, but it is loading slow. Pin
thatraja8-Jan-21 5:12
professionalthatraja8-Jan-21 5:12 
Questionhow to code following vb code to asp.net code Pin
Asanka Prabath1-Jan-21 19:07
MemberAsanka Prabath1-Jan-21 19:07 
AnswerRe: how to code following vb code to asp.net code Pin
Mycroft Holmes2-Jan-21 20:03
professionalMycroft Holmes2-Jan-21 20:03 
AnswerRe: how to code following vb code to asp.net code Pin
Richard Deeming4-Jan-21 23:04
mveRichard Deeming4-Jan-21 23:04 
QuestionUnable to read from web.config Pin
samflex11-Dec-20 7:35
Membersamflex11-Dec-20 7:35 
AnswerRe: Unable to read from web.config Pin
Richard MacCutchan11-Dec-20 7:42
mveRichard MacCutchan11-Dec-20 7:42 
GeneralRe: Unable to read from web.config Pin
samflex11-Dec-20 9:02
Membersamflex11-Dec-20 9:02 
GeneralRe: Unable to read from web.config Pin
Richard MacCutchan11-Dec-20 22:20
mveRichard MacCutchan11-Dec-20 22:20 
GeneralRe: Unable to read from web.config Pin
samflex12-Dec-20 4:16
Membersamflex12-Dec-20 4:16 
QuestionServer not recognizing AD info (SOLVED) Pin
samflex10-Dec-20 10:42
Membersamflex10-Dec-20 10:42 
AnswerRe: Server not recognizing AD info Pin
Richard Deeming11-Dec-20 0:25
mveRichard Deeming11-Dec-20 0:25 
GeneralRe: Server not recognizing AD info Pin
samflex11-Dec-20 3:20
Membersamflex11-Dec-20 3:20 
GeneralRe: Server not recognizing AD info Pin
Richard Deeming11-Dec-20 3:29
mveRichard Deeming11-Dec-20 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.