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 are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?

586


What is the state management in asp.net?

550


Which is faster viewdata or viewbag?

544


What are the main differences between asp and asp.net?

524


What language does asp.net use?

560






What is asp.net with mvc? : Asp.Net MVC

520


Web API uses which library for JSON serialization?

564


Write code to send e-mail from an asp.net application?

548


Asp pages that worked pefectly on windows 2000 server and iis 5.0 do not work on windows 2003 server with iis 6.0. Asp.net pages work fine. Why?

560


Why we go for mvc instead of asp.net? : Asp.Net MVC

493


Which is faster union or union all?

578


how to implement some securty aspect in our application i.e 1.cookie poisioning. 2.data encryption. 3.forcefull browsing 4.sql/code injection 5.securing web app by using web services ........my question is how to implement these thing in our application is this done by hard coding or by help of some tool

1643


Explain diff. Between friend and protected friend?

500


What is ispostback method in asp.net?

558


What are the uses of list view control in Asp.net?

617