Introduction
Here is Part 2
It is very-very lazy way to create a property
is to create a public field. For simple application it is good but if you are
working on very secure application then it is very important to point out all
such points too. We will discuss the better technique that is by using Private
Field in next article that is in Part - 4. If we declare any field with the
Public access modifier, then the field can be accessed from outside the
component. The example given below contains a public field named Welcome.

Class1.vb File Code
Imports
Microsoft.VisualBasic
Public
Class
Class1
Public WelcomeMsg
As String
Public Function SayMessage()
As String
Return WelcomeMsg
End Function
End
Class
Default.aspx File Code
<%@
Page Language="VB"
AutoEventWireup="false"
CodeFile="Default.aspx.vb"
Inherits="_Default"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Join the conversation! Your thoughts help the community grow.