Ivan Marković
MSP Lead
Software Developer at SPAN d.o.o.
ivan.markovic@studentpartner.com
Agenda
1) Web Apps
2) ASP.NET MVC
3) Web API
4) Demo, demo, demo, …
What is web application?
• A web application or web app is any
software that runs in a web browser.
Architecture of web app
Client
Server
DB
User
Web page != web app
Web app Web page
How does it work?
Client
Server
DB
User
1
2
3 4
5
6
Developing web apps
• Developing web apps:
Front-end web developer
Developing UI
Back-end web developer
Developing application logic
ASP.NET vs PHP Code Example
ASP.NET PHP
< %@ Page Language="C#" %>
<html>
<head></head>
<body>
< % for (int i = 1; i <= 100; i++)
{
Response.Write((i +
(i - 1)).ToString() + "<br />");
}
%>
</body>
</html>
<html>
<head></head>
<body>
< ?php
for ($i = 1; $i <=100; $i++) {
echo $i + ($i - 1) . "<br />";
}
?>
</body>
</html>
ASP.NET vs PHP Tools
• ASP.NET : Visual Studio + IIS + Microsoft SQL
• PHP: Eclipse + Xampp + MySQL
Razvoj web aplikacija
HTML+CSS+JavaScript
ASP.NET PHP
SQL
MVC
MVC
• ASP.NET MVC
• Web application framework
• Alternate for ASP.NET Web Forms
• MVC=Model-View-Controller
• Architectural pattern
Advantages of an MVC-Based Web
Application
• Easier to manage complexity(input logic, business logic, and UI logic)
• Better support for test-driven development(TDD)
• Better for large teams of developers
Model
Entity framework(EF)
• Object relational mapper(ORM) framework for .NET
• Eliminates the need for most of the data-access code that developers usually
need to write.
Entity Framework Development
Approaches
View
Razor
• View Engine for ASP.NET
• Optimized arround HTML
Razor-example
• <!DOCTYPE html>
• <html lang="en">
• <head>
• <meta charset="utf-8" />
• <title>Web Pages Demo</title>
• </head>
• <body>
• <h1>Hello Web Pages</h1>
• <p>The time is @DateTime.Now</p>
• </body>
• </html>
Controller
Controller
• The ASP.NET MVC framework maps URLs to classes that are referred to as
controllers
• The base class for all controllers is the ControllerBase class
The Controller class is responsible for
the following processing stages:
• Locating the appropriate action method to call and validating that it can be
called.
• Getting the values to use as the action method's arguments.
• Handling all errors that might occur during the execution of the action method.
Action Methods
• ASP.NET MVC applications is organized around controllers and action methods.
• The controller defines action methods. Controllers can include as many action
methods as needed.
• /[Controller]/[ActionName]/[Parameters]
Demo, demo, demo, …
Q & A
?
Thank you!
ivan.markovic@studentpartner.com

ASP.NET - Ivan Marković

  • 1.
    Ivan Marković MSP Lead SoftwareDeveloper at SPAN d.o.o. ivan.markovic@studentpartner.com
  • 2.
    Agenda 1) Web Apps 2)ASP.NET MVC 3) Web API 4) Demo, demo, demo, …
  • 3.
    What is webapplication? • A web application or web app is any software that runs in a web browser.
  • 4.
    Architecture of webapp Client Server DB User
  • 5.
    Web page !=web app Web app Web page
  • 6.
    How does itwork? Client Server DB User 1 2 3 4 5 6
  • 7.
    Developing web apps •Developing web apps: Front-end web developer Developing UI Back-end web developer Developing application logic
  • 8.
    ASP.NET vs PHPCode Example ASP.NET PHP < %@ Page Language="C#" %> <html> <head></head> <body> < % for (int i = 1; i <= 100; i++) { Response.Write((i + (i - 1)).ToString() + "<br />"); } %> </body> </html> <html> <head></head> <body> < ?php for ($i = 1; $i <=100; $i++) { echo $i + ($i - 1) . "<br />"; } ?> </body> </html>
  • 9.
    ASP.NET vs PHPTools • ASP.NET : Visual Studio + IIS + Microsoft SQL • PHP: Eclipse + Xampp + MySQL
  • 10.
  • 11.
  • 12.
    MVC • ASP.NET MVC •Web application framework • Alternate for ASP.NET Web Forms • MVC=Model-View-Controller • Architectural pattern
  • 13.
    Advantages of anMVC-Based Web Application • Easier to manage complexity(input logic, business logic, and UI logic) • Better support for test-driven development(TDD) • Better for large teams of developers
  • 14.
  • 15.
    Entity framework(EF) • Objectrelational mapper(ORM) framework for .NET • Eliminates the need for most of the data-access code that developers usually need to write.
  • 16.
  • 17.
  • 18.
    Razor • View Enginefor ASP.NET • Optimized arround HTML
  • 19.
    Razor-example • <!DOCTYPE html> •<html lang="en"> • <head> • <meta charset="utf-8" /> • <title>Web Pages Demo</title> • </head> • <body> • <h1>Hello Web Pages</h1> • <p>The time is @DateTime.Now</p> • </body> • </html>
  • 20.
  • 21.
    Controller • The ASP.NETMVC framework maps URLs to classes that are referred to as controllers • The base class for all controllers is the ControllerBase class
  • 22.
    The Controller classis responsible for the following processing stages: • Locating the appropriate action method to call and validating that it can be called. • Getting the values to use as the action method's arguments. • Handling all errors that might occur during the execution of the action method.
  • 23.
    Action Methods • ASP.NETMVC applications is organized around controllers and action methods. • The controller defines action methods. Controllers can include as many action methods as needed. • /[Controller]/[ActionName]/[Parameters]
  • 24.
  • 25.
  • 26.

Editor's Notes

  • #6 Web stranica uglavnom prikazuje nekakvu obavijest, samo daje informacije