Hello and welcome to this lecture.
This is a path for or build your first web app.
In this lecture we are going to write C sharp code that will determine the behavior of the page.
All right.
Back to visual studio.
We are going to double click on that.
Click Me Please button which is just double click on that and what that will do.
Notice it has generated some C sharp code.
It has also launched the new tab called Identity dot A S P X dot c Yes.
All right.
So notice we've got some C sharp code here.
And notice on line 19 we've got a cursor flashing and just above it we are caught curly braces.
You got the curly the opening curly braces and this close in curly braces and above it above the curly
braces.
We've got a block of code called O K button on the score.
Click this.
This is a this code here OK button on the clock on score click.
So what ever could we write in here will determine the behavior of this button.
So I'm gonna write a bunch of code.
I want you to write exactly the way I've written it.
Don't worry too much about understanding it at the moment.
Just try and follow along as much as possible.
All right.
So the first thing we're going to do going to type in the word string K note is this is called Intel
I think.
So it determines that you're trying to write something and gives the and gives you some clues as to
what it is you're trying to write.
So I'm trying to write strengths I just double click on the word string there to be string space
first name.
Notice I'm using Campbell case
please note the string here should be a lot.
The s should be a lower case.
OK we tells you that the string basically it's a text.
If you're trying to write a collection of text it's known as a string.
Okay so you can see the tooltip says that represents text as a series of Unicode characters.
So this is a string and I'm gonna give it first name and I'm going to apply an operator and give it
to equals to sign on I wonder.
Two equals two.
First name first
name
dot text.
So this will this here this first name here will be referenced in the text box the first name text box
and it is a text sensor.
Put it first name dot text.
Okay.
Whenever you go squiggly lines underneath that means visual studio is not happy about something.
So at the end of each line of code you need to put a semicolon to show that you have completed that
line of code when if you see squiggly red squiggly lines it means that visual studio is not happy about
something.
I think I know what the problem is.
Notice the string here when we did when we designed this list but when we designed the text box we the
text was called first name the actual name all source code first name so it looks like there may be
some conflict here.
So what we're going to do we gonna go back to the designer and re modify the name of the text box.
So go back to the design and click on view and go designer and click on the first name text box.
You're gonna go right down to the properties.
I've already done that I've added the name added box to it to modify that I'm gonna do the same here
with the last name com right here and just gonna add box so there is no conflict all right.
So if I now go back to my code by double click on this here.
You notice if I had a box here then the red squiggly lines should disappear.
If I do the same here with the last name.
Notice the red squiggly lines has disappeared so it didn't like the fact that my string was called first
name and the value was also called first name.
All right so I've made that you notice the red lines have disappeared.
When you've got the yellow strip here I just know that is a guide to let you know that you have not
saved your code okay let's continue with the code so I'm gonna go for another line here.
Just press and tell your keyboard a couple of times.
So on line 22 I'm gonna add on another string here.
Notice the intel says this.
So this little menu here is called Intel is ranked Intel is sense.
So I'm gonna add another string.
And this time it will be the result string.
So be all type result
the name of this string will be called result and the value we be equals to.
Hello.
All right.
And then I'm gonna add another text and to add I'm gonna use a plus operator
first name note is Intel I senses giving me a clue again.
It noticed I have already use some of these is asking me if I want to use them McCain.
Click on yes.
So I'm gonna do Hello.
Plus first name
space.
Plus
double quotes can give a big space.
This really is to create a space between the first name and the last name.
All right.
Will go higher.
The game to add the last name to a space and their last name.
Notice the intelligence again has come in handy.
Tell science is so useful it makes you write your code much faster.
Notice the rest quickly line.
It's telling me that hey what's going on.
You haven't finished.
So I need to put a semicolon there.
Notice this has now disappeared.
So what should happen in the text box.
If you input your name your first name a last name and click on the button it should say hello.
Your first name and your last name.
Your name is Joe Blog.
It should say hello Joe Bloggs.
That's what that is.
So we've got our code here.
Set up the final thing we need to do is to is to actually call the result the actual box the result
box.
So we need to define the result box so type result.
The result.
Label sorry.
Notice we created a results label.
So this would be the result.
Label dot text will click on the text that's what we want and we're going to give it a value and the
value will equals to the string here.
Code result the string we've created on line 22.
Okay.
She will lower case.
All right.
So that notice there are no red squiggly lines which is a good sign that everything is okay with your
code where you get as quick a line.
You should be worried.
Notice this yellow strip here is kind of my warning you that hey you have not saved your code so let's
save our code by clicking on this.
Is this this scared.
Just click on it.
It says Save or and that should turn green which means we have now saved our code.
Another way you can save your code you can do file.
I can do save all.
So it's the same option as what we've just done now that we've got our code save.
We can test how our web page application or the web app we've created.
We can test it.
So by clicking on this button here that says Google Chrome.
If this is suing Google Chrome because Google Chrome is my default web browser.
So if your default web browser Internet Explorer it will show Internet Explorer or whatever your default
web browser is.
So if I click on this it should run the code so click it to display it will launch hopefully soon.
Excellent.
So this is the web app we have created.
So once you click on that this is what comes up.
So let's type a name is a file type name in the file type name is Eric and and typing Williams
and click.
This tells me.
Hello.
Rick Williams.
All right.
So if you notice there is no space between the halo and the Rick and the first name.
But there is a space between the first name and the last name.
Let's try and fix that Sophia open back our code here.
So this is the code here.
So if you notice this here creates a space between the first name and the last name.
So where's gotten this second quotes here.
We're just going to create some space there.
You can actually make changes while your code is running.
So that's why you got that message.
You need to terminate your code before the you can make changes to the.
So to terminate your code from running you just click on this top button here that says stop debugging.
So you have to stop it before you can make any changes to your code.
So that has stop now.
So on to where it's got the halo there on line 22 I just create a bit of a space.
Notice the yellow strips come up showing that I have not saved an item.
So I click on Save and I will run the app in games by clicking on this Google Chrome thing.
So you can see the difference.
Now I put my first name last name.
You can see this that there's now a space between the halo and the first name and then the last name.
Okay.
So we achieved that by just creating this space in there.
So that is set when your code is running.
You get some diagnostics to zero that also runs which gives you an idea of the memory.
Your application is using.
All right.
So what I'm going to do.
I'm just going to terminate the code stop it by clicking or stop the program and that will stop it from
running.
All right.
So we have successfully created our first web app.
Well done.
If you've got any issues or if you had any errors along the way please feel free to let me know.
I apologize.
This lecture is taking twice as long as I expected.
Thanks for watching.
Bye for now.