IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
VB.Net
Search VB.Net Group:

Advanced
-Collapse +Expand VB.Net To/From
To/FromCODEGuides
-Collapse +Expand VB.Net Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingVB.NetWebForms (AS...   Print This     
  From the February 2008 Issue of Prestwood eMag
 
VB.Net WebForms (ASP.Net):
Your First ASP.NET Page
 
Posted 19 years ago on 12/12/2002 and updated 10/24/2009
Take Away:

This article provides a simple and free means of experimenting with ASP.NET

KB100082

Your First ASP.NET Page Using VB.Net

This article assumes you are familiar with ASP and are able to create a simple .ASP page that will display the current time.

While making the leap to ASP.NET might seem to require a substantial commitment of time and money, in fact you can get an ASP.NET host and ASP.NET development environment for free, and have your first ASP.NET page running within a hour.

Installing ASP.NET on your own server can be a complex task. You must first have access to IIS 5.0/5.1; then install MDAC 2.7; and finally install either ASP.NET or the .NET Framework SDK. However, if you already have access to an ASP.NET ready server, you can create .NET web pages with nothing more than notepad.

The IIS server uses the file extension to determine how to process a page. The extension .ASP is processed as a standard ASP file, while the extension .ASPX invokes the .NET processing.

The following script will display the time in ASP (put it insinde a standard HTML/Body tags)

<h1>Welcome Prestwood Members</h1>
 
The time is currently: <%=Time%>

A comparable ASP.NET script is:

Put this at the start of the page:

<script language="vb" runat="server">

 

Put this inside your body tags:

<script language="vb" runat="server">
Sub Page_Load() 
time.text=Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) 
End Sub 
</script>

 

Finally, the call to our sub:

<h1>Welcome Prestwood Members</h1>
 
The time is currently:
 
<asp:label id="time" runat="server" />

 

If your server is configured correctly and the extension is ".aspx", the above script will return the time. If it works the first time you might induce some bugs in order to view the superior debug reporting of ASP.NET.

The ASP.NET code resides between the <script> and </script> tags. The Page_Load function allows us to run code when an ASP.NET page is loaded.

ASP .Net supports two methods of utilizing code within the page. Using a


Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1182A1
Enter key:
Article Contributed By Kim Berry:

Kim Berry is an experienced coder currently specializing in VS.Net C# coding of WinForm and WebForm applications. Kim currently works part time for Prestwood IT Solutions and participates in this online community when time allows. Kim worked fulltime at Prestwood Software for four years and is still available for part time evenings and weekends work. He was one of the main Prestwood developers developing ASPSuite and has coded in many languages including C, Visual Basic, Delphi, and Visual Studio.Net.

Visit Profile

 KB Article #100082 Counter
6413
Since 4/2/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2021 Prestwood IT Solutions.   [Security & Privacy]