开发者

DotNetNuke module Page_Load fires twice

开发者 https://www.devze.com 2023-03-19 16:02 出处:网络
My module\'s Page_Load event is firing twice for each \"actual\" load. On the initial load both loads\' Page.IsPostBack property is false.

My module's Page_Load event is firing twice for each "actual" load. On the initial load both loads' Page.IsPostBack property is false.

I've renamed Page_Load to Module_Load to verify the name wasn't an issue. I've made sure the method isn't handling both Me.Load and MyBase.Load, which has been the case in the past.

The only thing I'm doing out of the ordinary is that my module is inheriting from an intermediate base class. Could this be the culprit?

My module:

Namespace Modules.RedactedNamespace
    Public Class List
        I开发者_如何转开发nherits RedactedModuleBase

        Protected Sub Module_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not Me.Page.IsPostBack Then
                BindList()
            End If
        End Sub

    End Class
End Namespace

My base:

Namespace Modules.RedactedNamespace
    Public MustInherit Class RedactedModuleBase
        Inherits DotNetNuke.Entities.Modules.PortalModuleBase

    End Class
End Namespace

Edit (This fixed it) - I had an Image without an ImageUrl. Presumably this is set by my CollapsiblePanelExtender but rendered with a blank src.


This can happen if you have an img tag with an empty src attribute.

I know this sounds strange, but I believe it has to do with the web browser trying to figure out how to load the image with a blank SRC.

I don't know the protocols involved, but I'd bet there is some ambiguity regarding how to resolve empty string.

So, in the case of some browsers, it actually fires a web request to the current URL hoping the image comes back.

Sounds like a reasonable assumption, but it just so happens to break many ASP.Net web forms.

0

精彩评论

暂无评论...
验证码 换一张
取 消