zoukankan      html  css  js  c++  java
  • 有关Substitution控件,好像Visual Studio 2005 beta2的bug

    这段时间在研究asp.net 2.0缓存功能,其中有一个缓存控件Substitution。我的代码是这样写的:

     1<%@ OutputCache Duration="60" VaryByParam="none" %>
     2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
     3<html xmlns="http://www.w3.org/1999/xhtml">
     4<head runat="server">
     5    <title>Substitution控件演示示例</title>
     6</head>
     7
     8<script runat="server" language="C#">    
     9    public void Page_Load(object sender, System.EventArgs e)
    10    {
    11        CachedDateLabel.Text = DateTime.Now.ToString();
    12    }

    13    public static string GetCurrentDateTime(HttpContext context)
    14    {
    15        return DateTime.Now.ToString();
    16    }
      
    17</script>
    18
    19<body>
    20    <form id="form1" runat="server">
    21        <div>
    22            <p>
    23                下面的时间显示没有使用缓存功能</p>
    24            <asp:Substitution ID="Substitution2" MethodName="GetCurrentDateTime" runat="Server">
    25            </asp:Substitution>
    26            <br />
    27            <p>
    28                下面的时间显示使用了缓存功能,只有在60秒后才改变</p>
    29            <asp:Label ID="CachedDateLabel" runat="Server"></asp:Label>
    30            <br />
    31            <br />
    32            <asp:Button ID="RefreshButton" Text="刷新页面" runat="Server"></asp:Button>
    33        </div>
    34    </form>
    35</body>
    36</html>
    37

    当执行以上页面时,总是报错:“以一种访问权限不允许的方式作了一个访问套接字的尝试。”我查看了我的Visual Studio 2005的基本配置,包括权限等内容,均没有问题。我想这是不是Visual Studio 2005 beta2的bug呢?大家来试验并讨论一下,希望共同进步。
  • 相关阅读:
    怎么样使图片高度与宽度成比例自适应
    css文本溢出隐藏显示省略号(单行+多行)
    Monkey脚本API简介
    Monkey自动化测试
    MonkeyRunner自动化测试
    Shell逐行读取文件的3种方法
    shell脚本中调用其他脚本的三种方法
    CPU测试--通过proc获取CPU信息
    CPU测试--查看cpu占用率
    shell脚本如何获取当前时间
  • 原文地址:https://www.cnblogs.com/polaris/p/220551.html
Copyright © 2011-2022 走看看