1

Apologies if this question is very trivial for most of you but i am a rookie trying to use HTML5 with asp.net web forms. Please don't ask why i am not using MVC4 or 5 as its a clients requirement. I don't understand why the page cannot find the referenced js files in my application.

My JS Scripts are in the following location: WebFormsTest->Scripts->WebForms Here is the code

@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs"    Inherits="WebFormsTest.Login" %> 

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head runat="server">
    <title>Login</title>
    <script  src="/Scripts/WebForms/jquery-1.10.2.js"></script> 
    <script  src="/Scripts/WebForms/jquery-ui-1.10.2.js"></script>
  </head>
  <body>
     <form id="form1" runat="server">
  </body>
</html>

When i run the following code i get the error message in firebug console saying the referencing scripts cannot be found. Eventhough the src is pointing to the right address why can't it find the files? Anybody got workaround for this?

Thank you

1 Answer 1

3

Try to use:

<script src="Scripts/WebForms/jquery-1.10.2.js"></script> 
<script src="Scripts/WebForms/jquery-ui-1.10.2.js"></script>

or:

<script src="~/Scripts/WebForms/jquery-1.10.2.js"></script> 
<script src="~/Scripts/WebForms/jquery-1.10.2.js"></script>
Sign up to request clarification or add additional context in comments.

2 Comments

@NathanP. Razor doesn't work with web forms. i'll try with <% %>
the first one worked. Thank you very much. The first occurrence of / had to be removed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.