OK、テキストボックスの値を取得したいのですが、JavaScriptコードのgetElementByID()を実行すると、テキストボックスのIDが元の値から変更されました。cliendIdMode="Static"を入れてみてもうまくいきませんでした。
<script type="text/javascript" language="javascript">
function uploadFileChange() {
var tbox = document.getElementById('txtFileName').value;
var fu = document.getElementById("FileUpload1").value;
if (tbox != fu) {
document.getElementById('txtFileName').value = document.getElementById("FileUpload1").value;
}
return false;
}
</script>
元のテキストボックスは次のとおりです。
<asp:TextBox ID="txtFileName" CssClass="textbox" ClientIDMode="Static" runat="server"
Width="300px" ReadOnly="true" />
しかし、それは次のようになりました:
<input name="fuFileInfo$txtFileName" type="text" readonly="readonly" id="fuFileInfo_txtFileName" class="textbox" ClientIDMode="Static" onclick="fuFileInfo_FileUpload1.click();return false;" style="width:300px;" />