Disabled TextBox content not PostBack to Server in ASP.NET 2.0
So you have to disable TextBox, so that value can not be entered. TextBox can be disabled by code in JavaScript:-
document.getElementById("textBox1").disabled="disabled";
The disabled TextBox in JavaScript can be eanble by
document.getElementById("textBox1").disabled=false;
But the problem is that ASP.NET 2.0 do not recognize value supplied in TextBox if it is disabled. This is the way they have changed ASP.NET structure from 1.1 To 2.0.
The solution to this that I have found for this problem is enable property of Form to submit Disabled Controls.
This can be achieved by this line in PageLoad
Page.Form.SubmitDisabledControls = true;