How do we make a poperty read only?

Answer Posted / jitender

Suppose we have a property BarColor
the to make it read only use

private string color;

public string BarColor
{
get
{
return(color);
}
} // No need to set it

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sdlc process?

530


What is Difference between Production Serves and Development Servers? And Suppose, m adding/deleting C# file in a project based on the Specific Requirement. These Files are Automatically updated in Production Servers? So Which tool is needed to do This One?

1514


Can we use a static function with a non-static variable?

510


What is server side session management?

530


How ViewstateMac works?

2366






What is the latest version of asp.net?

539


What do you mean by marshalbyref?

646


Can we set master page as a start page?

549


Differentiate between a page theme and a global theme?

526


What do you mean by View State and what is its role?

540


What is the difference between CC and BCC?

618


What is application variable?

523


What are the advantages of the code-behind feature?

545


How would ASP and ASP.NET applications run at the same time on the same server?

1951


Describe Segmentation With Paging?

634