# Build a Basic Website with ASP.NET MVC and Angular

**URL:** <https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975>\
**Category:** Developer Blog Comments\
**Created:** [December 21, 2018, 5:24pm UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975 "2018-12-21T17:24:46Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 21, 2018, 5:24pm UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/1 "2018-12-21T17:24:46Z")

</div>

[Build a Basic Website with ASP.NET MVC and Angular](https://developer.okta.com/blog/2018/12/21/build-basic-web-app-with-mvc-angular)

This tutorial walks you through building a basic website with [ASP.NET](http://ASP.NET) MVC and Angular.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 23, 2018, 3:38pm UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/2 "2018-12-23T15:38:16Z")

</div>

**Craig Carns**

Informative article, but I believe one of your titles are incorrect: “Create Your DbContext and Data Models in Angular” should be “in .Net/C#”.

I have used Auth0 in the past and will definitely give Okta a try.

My opinion:Also in the real world you should not tightly couple the frontend and api together by having .net control the routing.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 26, 2018, 9:32am UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/3 "2018-12-26T09:32:34Z")

</div>

**leebrandt**

The point of this article is really that no always do you HAVE to use Angular for the whole front end. Sometimes what you really need is an MVC app that has one page that is fluid and interactive. Like a multi-step wizard or an order form where some single-page activity makes it more user friendly.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [March 1, 2019, 5:43am UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/4 "2019-03-01T05:43:26Z")

</div>

**Tedd Van Diest**

I would discourage this approach. There’s no good reason why you should mix MVC views with Angular. If you need server side rendering, use Angular Universal. Do Angular the Angular way, not the .NET way.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [June 12, 2019, 6:13pm UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/5 "2019-06-12T18:13:13Z")

</div>

**Lou Dreadnot**

I agree. Mixing the two is a mess. I would describe the mess I am dealing with right now but I don’t want to spread the nightmares around.

I’ll tell you this; if the author of this software built the Golden Gate bridge it would have twice as much steel and concrete and no one would know how to use it.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [July 2, 2019, 5:37pm UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/6 "2019-07-02T17:37:18Z")

</div>

**William Westlake**

your article is out of date with respect to the Okta web site, there is no secret key given to complete the rest of this tutorial. How do you generate the PKCE ??

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [July 16, 2019, 5:25am UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/7 "2019-07-16T05:25:21Z")

</div>

**Mark Tabor**

The Secret key is there basically you are choosing the wrong application type 🙂

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [July 16, 2019, 3:35pm UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/8 "2019-07-16T15:35:24Z")

</div>

**William Westlake**

I chose Single Page App per the instructions. [https://uploads.disquscdn.c…](https://uploads.disquscdn.com/images/471fb728674ef2a486078b4f150468a06551dfd668fd3037d639316460df5ed6.png "https://uploads.disquscdn.com/images/471fb728674ef2a486078b4f150468a06551dfd668fd3037d639316460df5ed6.png")

There selections are different from the above. Implicit (Hybrid) is not there, so I selected Implicit. But either way the next page shows a ClientID and no Key.

[https://uploads.disquscdn.c…](https://uploads.disquscdn.com/images/f3d14896460ec79c05af4bdda0144df23765635f3f4fa0e29b9aa5a935665533.png "https://uploads.disquscdn.com/images/f3d14896460ec79c05af4bdda0144df23765635f3f4fa0e29b9aa5a935665533.png")

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [July 23, 2019, 12:03am UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/9 "2019-07-23T00:03:04Z")

</div>

**Bogdan Verbenets**

Import directives should start with './ and not with '…/ . Otherwise it won’t work.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [July 23, 2019, 12:04am UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/10 "2019-07-23T00:04:03Z")

</div>

**Bogdan Verbenets**

You forgot to mention that you need to create local database file WeightTracker.mdf .

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [July 30, 2019, 6:36pm UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/11 "2019-07-30T18:36:21Z")

</div>

**Will Rees**

If you wanted to create another Angular app w/in the MVC project, would you repeat the same steps and create another Angular project inside the MVC app?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [September 8, 2019, 11:00am UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/12 "2019-09-08T11:00:51Z")

</div>

**Vasanthakumar Chandrasekaran**

It works perfectly. but there is a problem when I refresh the page. since angular run with client side routing with AngularDataController’s Index action, when we click refresh then it calls server routing and it throws the error.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [October 28, 2019, 5:00pm UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/13 "2019-10-28T17:00:59Z")

</div>

**securetech integration**

Is this considered an SPA (Single Page Application)?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [March 3, 2020, 10:30am UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/14 "2020-03-03T10:30:47Z")

</div>

**Willa Anderson**

Asp dot net development service becomes important. This is a single example of it. Ibrahim, As a part of Moon Technolabs, I can say this is the best example of a model view controller. The best part of learning is authentication. Merging with angular will increase the security factor. That’s really good to learn and share.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [April 19, 2021, 6:34am UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/15 "2021-04-19T06:34:07Z")

</div>

**Ranjan Srivastava**

I have two applications one in MVC and the other is on [ASP.NET](http://ASP.NET) Boilerplate Angular .My requirement is to call the typescript file in angular application from the MVC application …i.e on button click. Can anyone advice me what is the best approach to call the ts file from MVC application.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [July 26, 2021, 11:02am UTC](https://devforum.okta.com/t/build-a-basic-website-with-asp-net-mvc-and-angular/16975/16 "2021-07-26T11:02:40Z")

</div>

**TechAffinity Consulting**

I read the whole blog and it’s very unique and informative. This is by far one of the best blogs on .Net technology.
