jquery prop()を使用して、テキストボックスを無効にすることができます。
$("[id$=txtTemp]").prop("disabled", true);
注:prop()は、jquery1.6以降でのみ使用できます。以前のバージョンを使用している場合は、代わりにattr()を使用できます。
$("[id$=txtTemp]").attr("disabled", "disabled");
編集:
ASP.NETはコントロールのIDを壊す傾向があるため、ページ上でコントロールを見つけるには、次のようないくつかの異なる方法があります。
$('[id$=txtTemp]')
$('#<%= txtTemp.ClientID %>')
編集:
コントロールがiframe内にある可能性があると思われるため、次のスタックオーバーフローの質問からこの解決策を見つけました:how-can-i-access-iframe-elements-with-javascript
function iframeRef( frameRef ) {
return frameRef.contentWindow ? frameRef.contentWindow.document : frameRef.contentDocument
}
var iframe = iframeRef( document.getElementById('iframeID') )
これで、次の方法でドキュメントであるかのようにiframeコンテンツを検索できるようになります。
iframe.getElementByID('<%= txtTemp.ClientID %>').disabled = true;