Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/466.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript TextBox.text值在页面未刷新时未更新_Javascript_Asp.net - Fatal编程技术网

Javascript TextBox.text值在页面未刷新时未更新

Javascript TextBox.text值在页面未刷新时未更新,javascript,asp.net,Javascript,Asp.net,我有一个文本框(tbadrese),它没有任何值。然后我在javascript中执行此操作: origin = document.getElementById("tbAdresse").value; if (origin == "") origin = <%=this.GetFormatStringCoordonnees("Paris")%>; else origi

我有一个文本框(tbadrese),它没有任何值。然后我在javascript中执行此操作:

 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;
如果(原点==“”)
起源=;
其他的
起源=;
如果没有,请发布更多关于元素和功能的详细信息