Re: Formsauthentication - Page_Load problem

From: Cy Huckaba (cyh_at_delete.t-3.com)
Date: 04/29/03

  • Next message: Cy Huckaba: "Re: secure pdf files"
    Date: Tue, 29 Apr 2003 16:49:10 -0500
    
    

    Try this in the intialize event

    private void InitializeComponent()
    {
       this.Load += new System.EventHandler(this.Page_Load);
    }

    That should work...not sure about the requirement for forms auth, never ran into
    that before. I tent to always set my autoeventwireup to false anyway.

    Cy

    "John McD" <judetherude@hotmail.com> wrote in message
    news:07fd01c30e97$e10c34f0$2f01280a@phx.gbl...
    > How is this done in C#?
    > Why does AutoEventWireup have to be set to false for the
    > login page with FormsAuthentication?
    >
    > TIA - John.
    >
    > >-----Original Message-----
    > >You can add the HANDLES syntax to the page load event
    > like this...
    > >
    > >Public Sub Page_Load(...) Handles MyBase.Load
    > > ...
    > >End Sub
    > >
    > >You are basically adding an event hook to that sub. You
    > are telling it to fire
    > >the load event of the class (webform) that your page is
    > inherited from.
    > >
    > >Cy Huckaba
    > >Austin, TX
    > >
    > >"John McD" <judetherude@hotmail.com> wrote in message
    > >news:027601c30e8b$18ebdea0$a301280a@phx.gbl...
    > >> How can I get the Page_Load code to execute while still
    > >> having the AutoEventWireup attribute set to false?
    > >
    > >
    > >.
    > >


  • Next message: Cy Huckaba: "Re: secure pdf files"

    Relevant Pages

    • Re: Net::SMTP fails
      ... script normally wouldn't come to if the auth section that I commented ... sub send_mail { ... Fear is the mind-killer. ...
      (comp.lang.perl.misc)
    • Re: Page_Load gets called twice
      ... Page_event, such as Page_Load, when you set AutoEventWireup to true or not set it to false. ... Test by setting AutoEventWireup to false, or by eliminating the Handles statement. ... 'This call is required by the Web Form Designer. ... Private Sub InitializeComponent() ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Setting credentials
      ... You can add pages in the web.config that ignore the auth mode.. ... > Is there a way to jump directly to the logon page and have it set the ... > sub submit_click ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: order of execution of page_load in a base and derived classes
      ... >> IIRC the Page_Load is added in the OnInit handler: ... >> override protected void OnInit ... >> private void InitializeComponent() ... >>> Public Sub New ...
      (microsoft.public.dotnet.languages.vb)
    • Re: order of execution of page_load in a base and derived classes
      ... >> IIRC the Page_Load is added in the OnInit handler: ... >> override protected void OnInit ... >> private void InitializeComponent() ... >>> Public Sub New ...
      (microsoft.public.dotnet.framework)