Jump2Learn
www.jump2learn.com PUBLICATIO
N
N
DEVELORINGWEBAPPLICATIONS
WITH
ASP.NET
Jump2LearnTheOnlineLearningPlace
LS
Ms.TwinklePanchal
|
Ms.KrishnaKhandwala
|
Mr.ChiragPrajapati
12 Unit-1Introductlonto
ASP.NET
get
returnroll_no;
Set
roll_no=value;
publicstringStudName
Get
returnname;
Set
name=value;
staticvoidMain(stringlargs)
studentmyStud=newstudent(};
Console.WritelLine(myStud.Roll_Nol;
Console.WriteLine(myStud.StudName);
1.5.4Methods:
Amethodisablockofcodewhichonlyrunswhenitiscalled.Theyareusedtoperform
certainactions,andtheyarealsoknownasfunctionsoftheclass.
ForExample:
Unit-1IntroductiontoASP.NET
15
/usingpropertytogetandsetthevalueofstudentName
publicstringStudName
get
returnname;
set
name=value;
I/usingpropertytogetandsetthevalueofRolINo
publicintR_No
get
returnroll_no;
set
rollno
=value;
classStudMain
staticvoidMain(string[largs)
students=newstudent();
Icalltosetpropertywithrespectivevaluetosetstandardfield'value'
s.R_No=1;