In code behind I am using the viewstate to store the default valuew of the textbox. On button submit I am checking whether the current value of textbox and view state value is equal. If it is equal I am returning the error message as textbox value is not changed. After that I used return statement. return Statement is used to terminate the to come out of the function. Below is the cs code.