Javascript TextBox.text值在页面未刷新时未更新
我有一个文本框(tbadrese),它没有任何值。然后我在javascript中执行此操作:Javascript TextBox.text值在页面未刷新时未更新,javascript,asp.net,Javascript,Asp.net,我有一个文本框(tbadrese),它没有任何值。然后我在javascript中执行此操作: origin = document.getElementById("tbAdresse").value; if (origin == "") origin = <%=this.GetFormatStringCoordonnees("Paris")%>; else origi
origin = document.getElementById("tbAdresse").value;
if (origin == "")
origin = <%=this.GetFormatStringCoordonnees("Paris")%>;
else
origin = <%=this.GetFormatStringCoordonnees(tbAdresse.Text)%>;
origin=document.getElementById(“tbAdresse”).value;
如果(原点==“”)
起源=;
其他的
起源=;
在此代码中,第一次加载时原点等于“”,这是正确的。当我在tbadrese origin=“something”中写“something”时,也可以。但是在else语句中,tbadrese.Text似乎总是等于“”
我从来不会在做这件事的时候刷新页面,我想这就是它不起作用的原因,但我真的不明白为什么。我可以在不刷新页面的情况下将tbAdresse.Text更新为其实际值吗?您不是要这样做:
origin = document.getElementById("tbAdresse").value;
if (origin == "")
origin = <%=this.GetFormatStringCoordonnees("Paris")%>;
else
origin = <%=this.GetFormatStringCoordonnees(origin)%>;
origin=document.getElementById(“tbAdresse”).value;
如果(原点==“”)
起源=;
其他的
起源=;
如果没有,请发布更多关于元素和功能的详细信息