×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

ASP.NET DX进来看一下

本文发表在 rolia.net 枫下论坛usually when clients request asp.net page, asp.net will fire an constructor method ,but this never happend on microsoft sample program DUWAMISH for C#.

I find some strang things in this program:
At html documet , if I set TRACE property with FALSE value, the page constructor been invoked only whe the source code have been changed and need to recompile .
if I set trace property with TRUE value, then the constructor will be invoked every time when refreshing or requesting the page.

the following is the source code of DUWAMISH

public class Default : Page
{
public Default()
{
Page.Init += new System.EventHandler(Page_Init);

byte[] array={90,91};
try
{
System.IO.FileStream aa =new System.IO.FileStream (
"I:\\test.text",System.IO.FileMode.Append
);
aa.Write(array,1,1);
aa.Close();

}
catch(System.Exception e1)
{

}
finally
{
}
}
}更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / ASP.NET DX进来看一下
    本文发表在 rolia.net 枫下论坛usually when clients request asp.net page, asp.net will fire an constructor method ,but this never happend on microsoft sample program DUWAMISH for C#.

    I find some strang things in this program:
    At html documet , if I set TRACE property with FALSE value, the page constructor been invoked only whe the source code have been changed and need to recompile .
    if I set trace property with TRUE value, then the constructor will be invoked every time when refreshing or requesting the page.

    the following is the source code of DUWAMISH

    public class Default : Page
    {
    public Default()
    {
    Page.Init += new System.EventHandler(Page_Init);

    byte[] array={90,91};
    try
    {
    System.IO.FileStream aa =new System.IO.FileStream (
    "I:\\test.text",System.IO.FileMode.Append
    );
    aa.Write(array,1,1);
    aa.Close();

    }
    catch(System.Exception e1)
    {

    }
    finally
    {
    }
    }
    }更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • 被 cache 住了,用的 shadow copy...
      • 是的,我修改了buffer 的属性,就不会出现我所说的问题,但问题的关键不是这里,还有另外的原因,因为。。。
        我建立了一个空白的ASP。NET WEB 应用程序,其document 的TRACE 的属性为FALSE, BUFFER 属性为 TRUE。并在其构造函数中设置了断点,
        那么每次在浏览器中刷新该页面的时候,都会运行到断点处。
        但这样的设置用在DUWAMISH 的项目中却不行。只有把BUFFER 的属性改为FALSE 或者把TRACE 的属性改为TRUE,那么构造函数在每次刷新页面的时候会被调用。

        这他妈的鬼问题困挠了我很久。