codice:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="campo1" runat="server">
<asp:ListItem>si</asp:ListItem>
<asp:ListItem>no</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
</div>
</form>
</body>
</html>
<script language="javascript" type="text/javascript">
// <!CDATA[
document.getElementById("campo1").onchange = function()
{
document.getElementById("TextBox1").disabled = this.value == "no";
//document.getElementById("TextBox1").readOnly = this.value == "no";
};
// ]]>
</script>