Link to home
Start Free TrialLog in
Avatar of JHankinson
JHankinson

asked on

Page_Load executing twice, autoeventwireup set to false

Hi All

I have smartnavigation turned off (have tried with it on), and AutoEventWireup set to false (have tried with it on too). I also have .Net Framework v1.1 with SP1 installed.

my page checks for a link parameter (form_id) on the load, if is is null it will open for a new entry, if not it will search for the form_id details and fill out the page for someone to approve / reject.

By default the page loads as \\server\eforms\nocharge.aspx
When using a parameter, normally accessed through a link, it opens as \\server\eforms\nocharge.aspx?form_id=10000

page load only gets called twice when there is a parameter in the link. This happens for all events (ie: clicks etc) when the parameter is present. if the link is the default version, it works fine and page load is only called once.

How could a parameter in a link be causing the page_load to execute twice, the second time not registering as a postback?


Shortened Sample Code:


Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub



    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       
        If Not Me.IsPostBack Then

            'Code Here

        End If
    End Sub



HTML Header:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="nocharge.aspx.vb" Inherits="eforms.nocharge"%>


Avatar of Elvio Lujan
Elvio Lujan
Flag of Argentina image

try puttin off the "Handles MyBase.Load"

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
       
        If Not Me.IsPostBack Then

            'Code Here

        End If
    End Sub
Avatar of JHankinson
JHankinson

ASKER

ok i just tried that, now the page_load doesnt get hit at all

i tried it with autoeventwireup set to true, that makes it hit the point, but it runs through twice again
i have fixed the problem

it was caused by one of my <td> tags containing a background="#000000" tag, where it should be bgcolor="#000000"

no idea how it got there

someone please close this question
ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial