Responses |
|
Hi bugwee.....
Can you convert this code in C#.....please?
Thanks and Regards
Akiii
|
hello Akiii,
Here's the code using c#.. Hope this may help..
protected void SetReadOnlyTrue()
{
foreach (Control ctrl in pnlBranch.Controls)
{
if (ctrl is TextBox)
{
((TextBox)ctrl).ReadOnly = true;
}
}
}
Regards,
Bugwee
|
|
Hi bugwee.....
Thanks friend........your code is working absolutely fine.....
But can you tell me on what occasions a text-box should be made read-only......?
Text boxes are used for writing texts ......right ?
Thanks and Regards
Akiii
|
|
Hello Akiii,
Mostly my projects are e.g. data entries or POS. Therefore, i have to set it to read-only when the users just want to view their previous entries.
Regards,
Bugwee
|
|
hi bugwee.....
Okay, but in what other scenarios we may use text box as readonly...?
Regards
Akiii
|
|
Hello Akiii,
We may set the textbox to readonly to prevent a malicious user from changing a Text value that is read-only.
Regards,
Bugwee
|
|
hi bugwee....
okay.....thanks for the info.....and the code....
keep posting.....
Regards
Akiii
|