简体   繁体   English

Asp.NET中的内联脚本中的空格

[英]Spaces in Inline scripting in Asp.NET

Today when I was working on some javascript in an Asp.NET page, I did something like this: 今天,当我在Asp.NET页面中使用某些javascript时,我做了如下操作:

<script type="type/javascript">
    var elementID = document.getElementById("<%=txtMyServerControl.ClientID %>")
</script>

And compiler threw an error and once I added a space between = and txtMyServerControl and it stopped complaining about it and worked. 然后编译器抛出一个错误,一旦我在=txtMyServerControl之间添加了一个空格,它就不再抱怨它并开始工作。 BUT however without space it is working perfectly on my co-worker's computer? 但是,如果没有空间,它是否可以在我的同事的计算机上正常工作?

Am I missing something? 我想念什么吗?

Note: This is the error, there wasn't any other problem and yes, I compiled several times before realizing this was the error. 注意:这是错误,没有其他问题,是的,在意识到这是错误之前,我编译了几次。

<script type="text/javascript">
    var elementID = document.getElementById("<%=txtMyServerControl.ClientID %>")
</script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM