Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 466
  • Last Modified:

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"%>


0
JHankinson
Asked:
JHankinson
  • 2
1 Solution
 
Elvio Lujan.Net Senior DeveloperCommented:
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
0
 
JHankinsonAuthor Commented:
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
0
 
JHankinsonAuthor Commented:
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
0
 
GranModCommented:
PAQed with points refunded (500)

GranMod
Community Support Moderator
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now