"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Sunday, December 5, 2010

getting value from a readonly or disabled textbox

In some cases we use javascript to show value on a text-box which has been disabled or read-only to avoid user to alter the value. If we try to get the value on server side it will show null. That really horrible, I faced that tragedy in my last project finally i find the solution also.


Code:



in c# codebehind, on the pageload method.
TextBox1.Attributes.Add("readonly","readonly");


Then you can extract values from textbox


Have a nice day... 'N happy Coding :)

No comments: