From the course: Learning ASP.NET Core: MVC, Razor Pages, Web APIs & Other Foundations

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Creating a JavaScript client

Creating a JavaScript client

- [Instructor] Before I can write the JavaScript code to connect to the message hub on the server, I first need to create a user interface for the message board. I'll start by adding a new navigation link to the project's layout page. I'll copy the LI element for the link to the homepage and paste it at the end of the list of navigation links. I'll update the new link to go to a page at slash message board. I'll also change the text for the link to messages. I now need to create the page I just linked to. I'll add it to the pages folder and name the file MessageBoard.cshtml. Because this will be a standard razor page, the first thing I'll add to the file is the page directive. I'll then page in some HTML for the user interface. This just creates a very basic interface I can use to input and display messages for the message board. The first div element that begins on line three contains a text box with an ID value of message input and a button labeled send message. Users can type their…

Contents