How to Lock Textbox in asp.net

Posted by Juvy_Paira under ASP.NET on 6/25/2012 | Points: 10 | Views : 3614 | Status : [Member] | Replies : 4
Hi everyone,

I want to know, how to lock a textbox control in ASP.NET (other than disabling the textbox & setting it to readonly ). I want to know if ASP.NET has any similar property like the "LOCKED" property in VB 6.0.

Thanks.....replies are highly appreciated...




Responses

Posted by: Dkummar on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down
hi Juvy Ann Paira,

there is no such property locked for textbox,
instead of this property we are using readonly.



N.dinesh kummar
Software Developer

Juvy_Paira, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Juvy_Paira on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down
Thank you for that Mr. N.dinesh kummar ...

Juvy_Paira, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhupentiwari on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down
If You are using read only you will get problem during validation. i m using follwing javascript code which does not allow user to type any thing in text box.. the value of textbox is coming from pop window. which i have not included in the post



function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode >= 0 && charCode <=255 )
return false;

return true;
}


<asp:TextBox ID="txt_clocation" runat="server" onkeypress= "return isNumberKey(event)" < /asp:TextBox>

Thanks n Regards
Bhupendra Tiwari

Juvy_Paira, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Juvy_Paira on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down

Thank you Mr. Bhupentiwari. I tried applying the codes u've given to me, that really works...thanks..

Juvy_Paira, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response