2 warnings occur in angular js is not valid? RRS feed

  • Question

  • User-1026236167 posted

    how to start angular in my code 2 warnings occur ng-app is not valid in body?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication16.WebForm1" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <script src="Scripts/angular.js"></script>
    <body ng-app >
    <form id="form1" runat="server">

    Wednesday, May 13, 2020 7:53 AM

All replies

  • User-1330468790 posted

    Hi prabhjot1313,


    I suggest you consider not adding angular to webforms project as angular and webforms both have their own functionalities. 

    More details, you could refer to a prievious thread: 

    Using Angular with asp.net 4.5 Web Forms


    Hope this can help you.

    Best regards,


    Thursday, May 14, 2020 3:31 AM
  • User753101303 posted


    It is shown by which tool? My guess is that it is just the Visual Studio HTML editor that just warn that ng-app is not a known HTML attribute. As pointed already using both Web Forms and Angular doesn't seems that a good idea. You have an existing web forms app that you want to modernize?

    If you ask me, I starting to even wonder if the current trend about piling up client side frameworks rather than taking advantage of all what HTML, CSS and JavaScript have to offer out of the box is really that a good idea.

    Thursday, May 14, 2020 10:50 AM
  • User-474980206 posted

    Depends on the type of application and UI desired. This forum only needs JavaScript to create/edit a post. It’s perfect for html/css for 90% UI. But look at current email. They can be designed like this, but it’s not popular. Most want the web version to match the desktop. 

    the more your app needs to act like a desktop, the more JavaScript required. Once the JavaScript is more code than the html/css you may need a framework.

    Friday, May 15, 2020 1:50 AM