views:

43

answers:

1

i have many aspx pages in one folder (100 pages) and they will keep increasing. I have 1 vb.net file which has the code for these pages. Can i call that pageload event in vb.net file from all these pages? currently im using this code, but its not reading the pageload event.

<%@ Page Language="VB" %>
<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
       newone_load(page)
    End Sub
</script>

vb.net page code -

Public Module NewOne
    Public Sub NewOne_Load(ByRef Page As Web.UI.Page)
    end sub
end module
A: 

I found a small error in your code: Add Handles Me.Load to your Page_Load sub

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

Else the sub will never be bound to the Load event.

Willem