The basics:
Using c# code above your HTML to hold variables:
@{ } <!DOCTYPE html>
Then you can add a object such as date and time:
var currentDateTime = DateTime.Now;
so then it looks like this:
@{
var currentDateTime = DateTime.Now;
}
and then you can implement the variable into your html such as this:
<body>
<h1>Helloe</h1>
<p>WebTechTuts</p>
<p>Right now it's @currentdatetime PM</p>
</body>
Now with using the above steps we can make a simple calculator.
var a = 4;
var b = 5;
var theSum = a + b;
using the basic programming numeracy skills you can then incorporate that code
into a body tag like we learnt above.
IF Statements
if(Whatever){
message = "Welcome";
}
This is bassically showing you if whatever = something then messagebox = welcome
Very basic more coming very soon this is getting harder as we go through so keep studying!
No comments:
Post a Comment