ASP.NET页面中Js的用途是什么 [英] What is the use of Js in ASP.NET page

查看:144
本文介绍了ASP.NET页面中Js的用途是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道

如果我在这两个标签之间写<%# %>,则Java Script中的内容

任何帮助...

I want to know

if I write <%# %> between these two tags, what''s happed in Java Script

any help...

推荐答案

Java脚本中的内容
通过在运行时使用反射,ASP.NET可以找到在<%#%>之间添加的事物的值.并相应地使用它.

您可以通过在页面呈现后执行ViewSource来看到相同的内容.
what''s happed in Java Script
Using reflection at runtime, ASP.NET find''s the value of the thing put up in between the <%# %> and use it accordingly.

You can see the same by doing a ViewSource of the page once it is rendered.


来自MSDN的此链接可能会帮助您:http://msdn.microsoft.com/en-us/library/6dwsdcf5(v=vs.80).aspx [ ^ ] ,然后尝试进行回复
This link from MSDN may help you: http://msdn.microsoft.com/en-us/library/6dwsdcf5(v=vs.80).aspx[^], try it then reply


在Javascript中什么也不会发生,直到调用了某些Javascript函数为止,并且直到在某些HTML DOM对象上触发了某些事件之后,这种情况才会发生. <%# %>中编写的只是HTML代码或其中的一部分.它可以包含或不包含一些Javascript.

您正在询问无关的事情.您真的了解<%# %>仅存在于服务器端吗?在客户端,您只有服务器生成的代码,而没有此占位符.您了解HTTP服务器的原理是什么以及Web浏览器中会发生什么吗?我认为,在使用Java脚本之前,您需要充分了解这一点.

也许您需要从头开始: http://www.asp.net/ [
Nothing happens in Javascript until some Javascript function is called, and this won''t happen until some event is fired on some of HTML DOM objects. What is written in <%# %> is just HTML code or part of it. It can contain some Javascript or not.

You''re asking about unrelated things. Do you really understand that <%# %> exists only on server side? On client side you have only the server-generated code instead of this placeholder. Do you understand what HTTP server does in principle and what happens in Web browser? You need to understand that well before you get to Javascript, I think…

Maybe you need to start from the beginning: http://www.asp.net/[^].

—SA


这篇关于ASP.NET页面中Js的用途是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆