==>> In this post i want to make asp .net text box read only using java script .Some time we need this type of functionality in your website so you can easily implement in your website just copy paste blow code on your aspx page :----
1. ASPX PAGE CODE:-
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Asp.Net Textbox Readonly using JavaScript </title>
<script type="text/javascript">
function SettxtboxReadOnly() {
var txtName = document.getElementById("txtboxName");
txtName.readOnly = "readonly";
}
</script>
</head>
<body onload=" SettxtboxReadOnly()">
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtboxName" runat="server" Text="Read Only"></asp:TextBox>
</div>
</form>
</body>
</html>
No comments:
Post a Comment