Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DotNetNuke module Page_Load fires twice

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
        Inherits 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.

like image 918
Orange Kid Avatar asked Jul 11 '11 15:07

Orange Kid


1 Answers

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.

like image 54
Brian Webster Avatar answered Nov 15 '22 07:11

Brian Webster