Page_Load中没有被要求重新导航 [英] Page_Load not being called on re-navigation

查看:192
本文介绍了Page_Load中没有被要求重新导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题。下面是该方案

I am having a strange problem. Here is the scenario

下面是我的文件:


  1. Project1.aspx

  2. Project2.aspx

  1. Project1.aspx
  2. Project2.aspx

他们都设置完全一样的,包括他们的Page_Load功能:

They are set up the exact same, including their Page_Load functions:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

If (Not Page.IsPostBack) Then

   setPrevIndex(-1)

   ...

   End If


End Sub

他们都建立了这种方式。

They are both set up this way.

下面就是我遇到了一个问题。当我浏览到这些网页,我需要确保prevIndex设置为-1(通过函数)。

Here is where I am running into a problem. When I navigate to either of these pages, i need to make sure that prevIndex is set to -1 (via the function).


  • 对于 Project1.aspx 当我浏览
    页面,在Page_Load火灾。

  • 对于 Project1.aspx 当我刷新页面,在Page_Load火灾。

  • 对于 Project1.aspx 当我preSS转到我在浏览器的导航栏,在回到当前页面,在Page_Load火灾。

  • For Project1.aspx when I navigate to the page, the Page_Load fires.
  • For Project1.aspx when I refresh the page, the Page_Load fires.
  • For Project1.aspx when I press "Go" in my browsers navigation bar, traveling back to the current page, the Page_Load fires.



  • 对于 Project2.aspx 当我浏览
    页面,在Page_Load火灾。

  • 对于 Project2.aspx 当我刷新
    页面,在Page_Load火灾。

  • 对于 Project2.aspx 当我preSS
    在我的浏览器的导航栏加油,
    旅行回到当前页面,
    在Page_Load不火了!的功能更是连
    调用。

  • For Project2.aspx when I navigate to the page, the Page_Load fires.
  • For Project2.aspx when I refresh the page, the Page_Load fires.
  • For Project2.aspx when I press "Go" in my browsers navigation bar, traveling back to the current page, the Page_Load doesn't fire at all! The function isn't even called.

任何想法,为什么?什么会导致此?

Any ideas why??? What would cause this?

请要求澄清。

更新:

当我preSS在指向同一个URL网址加油,好像母版是重新加载的唯一的事情,但Load_Page事件不火,甚至...

When I press "Go" in the URL pointing to the same URL, it seems like the masterpage is the only thing that re-loads, but the Load_Page event doesn't even fire...

任何其他建议?

谢谢,
Ë

推荐答案

尝试禁用输出缓存,看看是否仍出现该问题:

Try disabling output cache and see if the problem still occurs:

<system.web>
  <caching>
    <outputCache enableOutputCache="false"/>
  </caching>
<system.web>

这篇关于Page_Load中没有被要求重新导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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