2011-08-03 20 views
0

aspxページでLinkBut​​tonを無効にしようとしています。ASP.NET:JavaScript経由でLinkBut​​tonを無効にする

これは無効になっているようですが、灰色になっているのが本当に好きです。ここで私が使用しているものです:

function DisableVehicles() 
{ 
document.form1.lstVehicles.disabled = true; 
document.getElementById("<%= InsertVehicles.clientID %>").enabled = false; 
document.getElementById("<%= InsertVehicles.clientID %>").onclick = function() {return false;}; 
} 

LinkBut​​tonコントロールは、次のようになります。

<asp:LinkButton ID="InsertVehicles" BorderStyle="Solid" Font-Underline="False" Font-Size="Small" Font-Names="Tahoma" BackColor="#20548E" ForeColor="White" Height="16px" Width="150px" BorderColor="#20548E" runat="server"><center>Insert Vehicles</center></asp:LinkButton> 

は、それが標準、無効なコントロールのように見えるようにする方法はありますか? (すなわち:?グレーアウト)

おかげで、

ジェイソン

答えて

0

たぶん、これらのようなコード(あなたはCSS内のすべてのボタン要素のクラス.buttonを与える):

.button[disabled=true], .button[disabled=true]:hover, 
.button[disabled=disabled], .button[disabled=disabled]:hover 
{ 
    color: #cecece; 
    cursor:text !important; 
} 
関連する問題