When you try to set textbox readonly, it loses its value...
Reason is readonly controls are not posted back to server.

To solve the above problem use the below code.



Ref : here