on Page_Init event set this property
sampleLabel.Attributes["onClick"] = "ShowMessage();";
JavaScript
<script type="text/javascript">
function ShowMessage() {
__doPostBack("sampleLabel", "I am changed")
}
</script>
On page_load event of page check the source of post back
if (IsPostBack)
{
if (Request["__EVENTTARGET"] == "sampleLabel")
{
sampleLabel.Text = Request["__EVENTARGUMENT"];
}
}
The __doPostBack method usually generate by asp.net framework.