-
Junior Member
Asp.NET
Hai,
In one interview i faced one question but i coudn't answer that.
I have to create two text boxes for inserting two numbers and a button and onr more text box for getting result.
I have to use class and in this class i have to use properties instead of methods to get this text box values. how to do this
Pls help me...... Its urgent............
Thanks
Praseetha
-
Junior Member
Re: Asp.NET
U can use in this way for example
public class class1
private name, place, details as string
public property username() as string
get
return name
end get
set(byval value as string)
name = value
end set
end property
public property userplace() as string
get
return place
end get
set(byval value as string)
place = value
end set
end property
public readonly property displayuserdetails() as string
get
details = username + " place is " + userplace
return details
end get
end property
end class
then u can use this class like
dim k as new class1
k.username = textbox1.text
k.userplace = textbox2.text
textbox3.text = k.displayuserdetails
so here we are utilizing properties not methods
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules