Note that there are some explanatory texts on larger screens.

plurals
  1. POng-include isn't working on ASP.NET app
    text
    copied!<p>I'm developing an ASP.NET application and i'm trying to use angular.js in my app.</p> <p>For some reason, when using ng-include, I cannot see the html i'm trying to embed.</p> <p>Here is my code:</p> <p>Default.aspx:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyPage.aspx.cs" Inherits="DefaultWebApp.Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:ng="http://angularjs.org"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;link rel="Stylesheet" href="Style/style.css" type="text/css" /&gt; &lt;link rel="Stylesheet" href="JS/jquery/css/start/jquery-ui-1.8.21.custom.css" type="text/css" /&gt; &lt;script type="text/javascript" src="js/jquery/js/jquery-1.7.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery/js/jquery-ui-1.8.21.custom.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body ng-controller="RouteCtrl"&gt; &lt;div id="content"&gt; &lt;div ng-include src='"Template/IncludeCheck.html"'&gt;&lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript" src="JS/angular.min.js" ng:autobind&gt;&lt;/script&gt; &lt;script type="text/javascript" src="JS/controllers.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>controllers.js:</p> <pre><code>function RouteCtrl($route) { var self = this; $route.when('/multi', { template: 'Template/IncludeCheck.html' }); $route.otherwise({ redirectTo: '/multi' }); $route.parent(this); } </code></pre> <p>IncludeCheck.html:</p> <pre><code>&lt;h1&gt;Include check&lt;/h1&gt; &lt;p&gt;Include check include check&lt;/p&gt; </code></pre> <p>I can see in my browser that "angular.min.js" and "controllers.js" gets loaded successfully, and I also have checked the relative paths and it's ok.</p> <p>What else I can look up to ?</p> <p><strong>UPDATE:</strong></p> <p>Just want to mention that I ain't using MVC on my project. </p> <p>Is it suppose to work in a regular ASP.NET app ?</p> <p>It's important also to mention that I ain't see in "Developer Tools" that "IncludeCheck.html" gets loaded.. even when I changed the path.</p> <p><strong>UPDATE 2:</strong></p> <p>I also cannot reach "/multi" .. I'm getting 404 not found</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload