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

How would you turn off cookies on one page of your website?

535


What is a page life cycle? What are the events in a page life cycle?

487


What are the authentication types in asp.net?

571


What is AutoPostback?

591


Are there resources online with tips on asp to asp.net conversions?

542






What is the use of worker process in asp.net?

525


What is Dynamic Web and discuss its usage with the help of real life examples?

594


What is masterpage?

507


When using the Pager object, inorder to know which page to go, which property you have to set to grid?

561


What is ashx file in asp.net?

544


What is the difference between pathparam and queryparam?

573


Explain the differences between managed and unmanaged code?

499


What is true about application service provider?

487


5. What three Specific Job Positions do you target from Swatz Oils GROUP U.K?

1761


Explain in what order a destructors is called.

577