简体   繁体   中英

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:

<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. 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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