Image Gallery With SignalR

Slides:



Advertisements
Similar presentations
Servers- Apache Tomcat Server Server-side scripts- Java Server Pages Java Server Pages - Xue Bai.
Advertisements

JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
The Web Warrior Guide to Web Design Technologies
Nikola Dimitroff Creating Genres creatinggenres.com.
Lesson 4 Advanced Forms Handling. Aggravations Long forms that make you scroll out of the normal viewing area Lets create a scrollable form that is a.
Building Social Web Apps in ASP.NET. First HalfSecond Half (01)What’s New in ASP.NET 4.5 (60 mins)** MEAL BREAK ** (02) Building and Deploying Websites.
NuGet Sweet, but not edible Chris
UNIT-e Launch Pad (Mobile) Technology Day - November 2011.
Building Real Time Applications with ASP.NET SignalR 2.0
SignalR Real Time with SignalR Jared Rhodes Senior Consultant Magenic.
JQuery CS 268. What is jQuery? From their web site:
JavaScript & jQuery the missing manual Chapter 11
Introduction to JavaScript Dr. John P. Abraham University of Texas – Pan American.
Server-side Scripting Powering the webs favourite services.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
JavaScript: Functions © by Pearson Education, Inc. All Rights Reserved.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
Lap Around Visual Studio 2008 &.NET 3.5 Enhancements.
Ajax XMod for Dummies Building DNN Ajax Modules Without Programming Dave McMullen SoCal DNN Users Group 2/7/07 –
Facebook API Kelly Orser. Client Libraries Client libraries will simplify the calls to the platform by reducing the amount of code you have to write.
Building a Web API for browser/JSON clients.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
ASP.NET SignalR SoftUni Team Technical Trainers Software University
ASP.NET User Controls. User Controls In addition to using Web server controls in your ASP.NET Web pages, you can create your own custom, reusable controls.
05 | Integrating JavaScript and MVC 4 Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
ASP.NET Identity System
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
Keith Telle Lead Software Engineer Bit Wizards Behind the Magic: SignalR Demystified.
ASP.NET 5 WHAT HAPPENED TO SESSION AND APPSETTINGS.
Tarik Booker CS 120 California State University, Los Angeles.
REEM ALMOTIRI Information Technology Department Majmaah University.
By: Ahmed Marzouk OWIN & KATANA. Agenda A Brief History What is OWIN and Why? What is KATANA? OWIN Specifications OWIN/KATANA Goals.
Jim Fawcett CSE686 – Internet Programming Spring 2014
DYNAMIC CONTENT DELIVERY
Computing with C# and the .NET Framework
“Under the hood”: Angry Birds Maze
JDBC Database Management Database connectivity
Jim Fawcett CSE686 – Internet Programming Spring 2012
ASP .NET MVC Authorization Training Videos
Web Forms, HTML, and ASP.NET
ASP.NET SignalR SoftUni Team C# MVC Frameworks Technical Trainers
JavaScript is a programming language designed for Web pages.
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Intro to JavaScript CS 1150 Spring 2017.
© 2016, Mike Murach & Associates, Inc.
JavaScript Client-side
Explore web development with Microsoft ASP.NET Core 1.0
Introducing ASP.NET Core 1.0
Should I Transition to .NET Core? Will it hurt?
A Quick Overview of ASP.NET Core 1.0
Events Comp 205 Fall 2017.
ASP.NET Module Subtitle.
ASP.NET Core* MVC and Web API Shahed Chowdhuri
Lighting Up Real-time Web Communications with SignalR
Please send any images as a separate file
For this assignment, copy and past the XHTML to a notepad file with the .html extension. Then add the code I ask for to complete the problems.
ASP.NET MVC Web Development
JavaScript Basics What is JavaScript?
Programming games Share your plans for your virtual something.
JavaScript is a scripting language designed for Web pages by Netscape.
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
Introduction to JavaScript
#01# ASP.NET Core Overview Design by: TEDU Trainer: Bach Ngoc Toan
Cross Site Request Forgery (CSRF)
Concepts in ASP.NET Core App
Application Startup in ASP.NET Core
Other options Note: Style switcher.
Building Your First ASP.NET Core Web Application
ASP.NET Core Middleware Fundamentals
Presentation transcript:

Image Gallery With SignalR A way to get real time communication

Displaying the images The goal of this presentation is to present an image gallery where users can like images Thumbnails are created dynamically for the gallery ASP.NET Core Middleware can be used to present these in an intuitive way This is not so intuitive in MVC 5

ASP.NET Core Middleware

Middleware for displaying images Create a middleware extension on IApplicationBuilder The extension handles the result if the request path has a particular format Otherwise it passes the request to the next piece of middleware The middleware is added to the Configure method of the Startup file app.GetGalleryImage(env); The image is displayed by setting the img src tag to @Url.Action("GetGalleryImage", "Gallery", new {id = @Model[j].ImageName})

Using signal4 in mvc 5 with .Net 4.6.1 Start by adding the NuGet package Microsoft.AspNet.SignalR Next create a hub A hub enables communication between all users of the application It is a class derived from Hub Here a method called LikeImage is called whenever a user likes an image The hub broadcasts this information to users

authentication Authentication is required to produce a Facebook like experience In the Configuration class of Startup we need app.MapSignalR(); GlobalHost.HubPipeline.RequireAuthentication(); Here app is the parameter IAppBuilder

Calling the hub The Hub is called through javascript Two JavaScript files must be added: <script src="~/Scripts/jquery.signalR-2.2.0.min.js"></script> <script src="~/signalr/hubs"></script> A reference is made to the Hub var demoHub = $.connection.signalRDemoHub; The $.connection.hub.start().done function hooks up the Like button event to a call to demoHub.server.likeImage(userId, imageId);

Receiving the broadcast message In this case the Hub broadcasts to all client It calls the method AddNewMessageToPage It is picked up in javascript by a function demoHub.client.addNewMessageToPage This method hides the Like button for the user who liked the image It adds 1 to the total image Likes for all clients of the application

Resources https://github.com/carolynlschroeder/MiddlewareDemo https://github.com/carolynlschroeder/SignalRDemo4_6_1 http://schroederconsulting.org/Presentations