ASP.NET Tutorial – Chapter 1: Starting with ASP.NET


To start testing how ASP.NET works you must have to write a HTML file
and then introduce the code in order the Internet Information Service
and the Engine of ASP.NET can process it. Since the previous versions
of ASP we know that the code between these tags <% –%> is the ASP
code. This code can be save in a file *.asp. For instance, if your
file name is INDEX, the file should be saved as INDEX.asp.

Dynamic pages in ASP.NET

Let’s see a simple code where you can see how to run a traditional page
of ASP.

<html>
<body bgcolor="green">
<center>
<h2>WELCOME TO THE TUTORIAL OF ASP.NETh2>
<p><span style="color: #0000ff;"><%Response.Write(now())%></span></p>
</center>
</body>
</html>


There are a lot of programmers that prefer using ASP.NET due the great
diversity of features that can be easily adapted to your needs. Now you
have a good reference that tells you how to combine HTML tags with the
previous versions of ASP. It is very simple and we are going to see
dozens of examples that will lead you to learn and investigate more and
more about ASP.NET. Now we are going to how ASP.NET works.

The ViewState in ASP.NET:

Let’s see some examples where is applied the ASP.NET ViewState. It’s
is very important because you can keep a good interactivity with end
users while you run your dynamic web pages in ASP.NET. The following
example will ask your name and once you type your name will appear a
message in the screen saying. “Good Morning + Your name”. Check this
code and then try to modify it in order you can get most of out of it.

<html>
<body>
<span style="color: #ff6600;"><form action="viewstate.aspx" method="post">
Your name: <input type="text" name="fname" size="30">
<input type="submit" value="Submit">
</form></span>
<span style="color: #0000ff;"><%
dim fname
fname=Request.Form("fname")
If fname<>"" Then
Response.Write("Good Morning " &amp; fname &amp; "!")
End If
%></span>
</body>
</html>

You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.