我正在使用此功能
<script type="text/javascript" language="javascript">
function readwebconfig() {
var sessiontime = "<%= Session.Timeout %>";
alert(sessiontime);
}
</script>
现在,我想将此sessiontime
值分配给标签文本,我该怎么做。
<asp:Label ID="lblmsg" runat="server"></asp:Label>
提前致谢
答案 0 :(得分:1)
尝试
document.getElementById("lblmsg").innerHTML = sessiontime;
答案 1 :(得分:1)
试试这个
<script type="text/javascript" language="javascript">
function readwebconfig() {
var sessiontime = "<%= Session.Timeout %>";
document.getElementById("lblmsg").value = sessiontime;
alert(sessiontime);
}
</script>
答案 2 :(得分:1)
试试这个
<script type="text/javascript" language="javascript">
function readwebconfig() {
var sessiontime = "<%= Session.Timeout %>";
document.getElementById('<%= lblmsg.ClientID%>').innerHTML=sessiontime;
}
</script>
答案 3 :(得分:0)
你是否尝试过这样:
function readwebconfig() {
var sessiontime = "<%= Session.Timeout %>";
document.getElementById('lblmsg').innerHTML = sessiontime;
}