小编Sym*_*een的帖子

ASP.NET OutputCache和Cookies

有谁知道为什么如果我的页面上有cookie,输出缓存不起作用!

示例页面

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ct.aspx.vb" Inherits="ct" %>
<%@ OutputCache Duration="600" Location="Server" VaryByParam="none" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <h1>Cache test</h1>
      <p id="rndout" runat="server"></p>
    </div>
    </form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

后面的示例代码:

Partial Class ct
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Dim rc As New Random()
        Dim rn As Integer
        rn = rc.Next()
        rndout.InnerHtml = rn.ToString

        Response.Cookies("sym")("hello") = "world"
        Response.Cookies("sym").Expires = DateTime.Now.AddDays(370) …
Run Code Online (Sandbox Code Playgroud)

asp.net cookies outputcache

9
推荐指数
2
解决办法
7497
查看次数

函数中的window.open替换当前选项卡以及打开新选项卡

我有一个有趣的复杂功能我想了解,如果我有window.open作为锚的onclick事件,则根据需要打开一个新选项卡.如果onclick调用一个函数,而该函数又会调用window.open会打开一个新选项卡,但当前选项卡也会获取新的url.

我可以证明它在这里 ,当你点击链接它工作正常,wheras 这里的URL在结果区域也开的!

谢谢Symeon.

javascript

4
推荐指数
1
解决办法
990
查看次数

标签 统计

asp.net ×1

cookies ×1

javascript ×1

outputcache ×1