Skip to content

Commit

Permalink
Update practice.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
malvoria authored Oct 11, 2018
1 parent ffa7267 commit 5a73f49
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Lectures/Lecture4/practice.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@
"metadata": {},
"source": [
"\n",
"# Activities"
"# Activities (Optional)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this practice you will learn how to setup an MVC application with a template engine. The template engine that we will use is called Razor. Razor is a __markup syntax__ that allows to embed server-based code into web pages by means of C#.\n",
"In this practicum you will learn how to setup an MVC application with a template engine. The template engine that we will use is called Razor. Razor is a __markup syntax__ that allows to embed server-based code into web pages by means of C#.\n",
"\n",
"\n",
"\n",
"Before showing how to setup such a project we will first take a look at what is HTML. This is necessary to understand the fundamental components that are necessary to build the View entity in our MVC.\n",
"Before showing how to setup such a project we will first take a look at what is HTML. This is needed to understand the fundamental components that are necessary to build the View entity in our MVC.\n",
"\n",
"#### Introduction to HTML\n",
"HTML (Hyper Text Markup Language) is a markup language (so it is not a programming langauge) for creating _static_ web pages. Markups are a set of tags that describe how text should be diplayed on a web page.\n",
"HTML (Hyper Text Markup Language) is a markup language (so it is not a programming langauge) for creating _static_ web pages. Markups are a set of tags that describe how text should be displayed on a web page.\n",
"\n",
"Every HTML page is made by the following items:\n",
" - Head, contains info about the webpage\n",
" - Body, contains the actual body to display on the screen\n",
" \n",
"<img src=\"1.JPG\">\n",
"\n",
"When we run the code above the out on your browser will be:\n",
"When we run the code above the output on your browser will be:\n",
"\n",
"<img src=\"2.JPG\">\n",
"\n",
"\n",
"Since pages in HTML are static typical programming elements such as while loops, calling a function, etc. are not found. Reason why to allow dynamism in pages we need expressive tools, such as a programming langauge. The choice of where to simulate such dynamic behavior is currently not trivial, since we are simulating the behavior of distributed applications. The possible options to run code in a html are different and depend on the context.\n",
"Since pages in HTML are static, typical programming elements such as while loops, calling a function, etc. are not found. This is the reason why to allow dynamism in pages we need expressive tools, such as a programming language. The choice of where to simulate such dynamic behavior is currently not trivial, since we are simulating the behavior of distributed applications. The possible options to run code in a html are different and depend on the context.\n",
"Code could be executed completely on the browser (client side), completely on the server, or a trade-off. Today we will see the second option, that is how to run code on the server. \n",
"\n",
"\n",
"In order to achieve this, we will use Razor together with ASP.net. In Razor a template file, which is made of a mix of literal text (a sort of HTML), is mixed up with C# statements (not all C# statements are allowed [1]). When all required data for a view are available the template engine will take care of embedding this data into the template and send the resulting page to the client. The page comes in the shape of a HTML page that can be interpreted by a common browser. ___In a template file Razor syntax starts with the __@__ sign. This sign will be used to automatically start parsing a statement by the engine, otherwise the HTML code will be directly pushed without any further processing. ___\n",
"In order to achieve this, we will use Razor together with ASP.net. In Razor a template file is made of a mix of literal text (a sort of HTML) and C# statements (not all C# statements are allowed [1]). When all required data for a view are available, the template engine will take care of embedding this data into the template and send the resulting page to the client. The page comes in the shape of a HTML page that can be interpreted by a common browser. __In a Razor template file, C# statements starts with the __@__ sign. This sign will be used to automatically start parsing a statement by the engine, otherwise the HTML code will be directly pushed without any further processing. __\n",
"\n",
"\n",
"<img src=\"0.jpg\">\n",
Expand Down

0 comments on commit 5a73f49

Please sign in to comment.