In actual development, if a news system needs to use js to call news of a certain category.
Non-codebehind version
Showjs. aspx
----------------------------
<% Response. Write ("document. Write ('output')") %>
Showjs.html
---------------------------
<Script language = "JavaScript" src = "showjs. aspx"> </SCRIPT>
In this example, the "output" can be output by using showjs.html"
Codebehind
Use vs. Net to create showjs. aspx and then add the htmlCodeDelete all
<% @ Page Language = "C #" codebehind = "showjs. aspx. cs" autoeventwireup = "false" inherits = "hover. showjs" %>
Then in the page_load () file in showjs. aspx. CS
Response. Write ("document. Write ('output ')");
In this way, the output is normal.
If you call showjs. aspx in showjs.html, a script error is reported.
Because when you view the HTML code of the showjs. aspx runtime, you understand that the output is not only document. Write ('output ')
The HTML code of the default document including aspx cannot be called!
Thanks for your advice. It is really most valuable professional. That enthusiasm is enough for learning. I hope I don't bother him. Oh! This problem is easy for me to understand. Ah