在ASP.NET中,做内联前pressions前或背后的code后得到执行? [英] In ASP.NET, do inline expressions get executed before or after the code behind?

查看:99
本文介绍了在ASP.NET中,做内联前pressions前或背后的code后得到执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASP内联前pressions <%。 ..%GT; 获得前或在code后,服务器上运行code-后面执行

Do ASP inline expressions <% ... %> get run on the server before or after the code in the code-behind is executed?

推荐答案

在线code后,在asp.net页面生命周期prerender页面执行。因此有,它可以运行之前,某些事情,某些事情可以后运行。在页面生命周期读到这里:

Inline code executes after prerender page in the asp.net page life cycle. Because of this there are certain things that it can run before and certain things it can run after. Read up on the page life cycle here:

http://msdn.microsoft.com /en-us/library/ms178472(v=vs.100).aspx

在prerender随之而来的事件有:

The events that come after prerender are:


  • preRenderComplete

  • SaveStateComplete

  • 渲染

  • 卸载

因此​​,在其他页面生命周期事件的任何code将首先执行。

So any code in the other page lifecycle events will execute first.

微软的文档:

这是嵌入式code块是服务器code,在页面的执行
  呈现阶段。

An embedded code block is server code that executes during the page's render phase.

这篇关于在ASP.NET中,做内联前pressions前或背后的code后得到执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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