Results 1 to 6 of 6

Thread: AutoEventWireup in ASP.NET

  1. #1
    Join Date
    Nov 2009
    Posts
    117

    AutoEventWireup in ASP.NET

    Hello, I am learning Asp.net and there is one confusion while learning it. I have search on internet regarding AutoEventWireup, but it is not possible for me to understand it. I have check the all of the details, but it is not possible for me to get the exact overview of the term. If anyone is having knowledge about it, then please provide me details about it. I will be thankful to you.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: AutoEventWireup in ASP.NET

    If one defines the aspx page AutoEventWireup to True as below:
    Code:
    <%@ Page Language="C #" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
    Then you force a mapping of certain events page. For example, the Page_Load method is called after the OnLoad method. This mapping is ease of use to avoid having to override the Page, but it is a heresy in terms of performance. The framework will use reflection and delegates for us simply avoid overloading.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: AutoEventWireup in ASP.NET

    You can set the AutoEventWireup property to false as below:
    Code:
    <%@ Page Language="C #" AutoEventWireup="fase" CodeFile="Default.aspx.cs" Inherits="Default" %>
    				
    protected override void OnLoad(EventArgs e)
    {
    	Basic.OnLoad(e);
    }
    instead of:
    Code:
    <%@ Page Language="C #" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
    protected void Page_Load(object sender, EventArgs e)
    {
    }

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: AutoEventWireup in ASP.NET

    Hello, AutoEventWireup is a property which is having either value as true or false. Bydefault it is having value as false. If you want to specify the value to the property of the AutoEventWireup attribute then you must need to use the locations below:
    • Machine.config file.
    • Web.config file.
    • .aspx files
    • .ascx files

  5. #5
    Join Date
    Apr 2008
    Posts
    2,005

    Re: AutoEventWireup in ASP.NET

    Hello, I am also beginner into the Asp.net, but I have some knowledge about the AutoEventWireup in ASP.NET. It is having boolean value. If you want to declare the value of this attribute then you must need to make use of the declaration in the <pages> section in the Machine.config file or the Web.config file. You can make use of the code below for this purpose.

    Code:
    <configuration> <system.web> <pages autoEventWireup="true|false" 
                   /> </system.web> </configuration>

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: AutoEventWireup in ASP.NET

    Hello, If you are making use of the C#.net then you will come to know that the value of the AutoEventWireup is true bydefault for the c# form. But, if you are making use of the vb.net for this purpose the you will come to know that the value of this property is bydefault as false. As the event handling technique changes in both of the cases it is providing the different default value for the c# and vb.net.
    You can make use of the code below for this purpose.

    Code:
    Protected Sub Page_Load(ByVal Test As Object, _ByVal one As system.EventArgs) _
                            Handles Me.Load
        ' ...
    
    End Sub

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,857,977.94685 seconds with 15 queries