日期:2014-05-18  浏览次数:20409 次

Repeater 控件奇怪的問題
我在Repeater控件的<FooterTemplate>中添加了一個Lable 控件給該Lable控件賦值。
如:document.getElementById("Rep1_ctl16_Lab_CurrentImMonth").value = "Test";
用window.alert(document.getElementById("Rep1_ctl16_Lab_CurrentImMonth").value )可以把值彈出來
就是在頁面上不能把值顯示出來。

------解决方案--------------------
1.Rep1_ctl16_Lab_CurrentImMonth已经是ClientID了吗?

2.
 document.getElementById("Rep1_ctl16_Lab_CurrentImMonth").InnerText = "Test"; 

------解决方案--------------------
document.getElementById("Rep1_ctl16_Lab_CurrentImMonth").innerHTML= "Test";
------解决方案--------------------
js赋值的话 ,onblur事件 ,光标离开repeater控件时,赋值 ?
别用value ,用innerHTML 赋值 。看看