---
title: "AutoEventWireup - true eller false?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/154953-autoeventwireup-true-eller-false"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "JulleBoy"
published: "2006-12-17T13:32:30.000Z"
updated: "2006-12-21T19:53:40.000Z"
replies: 1
views: 428
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/154953-autoeventwireup-true-eller-false"
---

# AutoEventWireup - true eller false?

## #1 — JulleBoy, 2006-12-17T13:32Z

Tror att jag har förstått vad AutoEventWireup gör men jag kan fortfarande inte riktigt få till det. Hur ska man egentligen göra, ska man sätta denna till true eller false? Och vad sätts denna till som default om man t.ex. skriver:

```
<%@ Page Language="C#" CodeFile="code_behind/UserList.aspx.cs" Inherits="UserList" %>
```

Jag har testat att sätta den till både true och false men märker ingen skillnad. Min Page_Load ser t.ex. ut som följande:

```
protected void Page_Load() {
    // Något körs
}
```

Sen undrar jag också om default för AutoEventWireup är olika för Web Forms (aspx) och User Controlls (ascx)?

Permalänk: https://www.webforum.nu/p/154953

## #2 — Lilly, 2006-12-21T19:53Z

På denna sida står följande: <http://www.codeproject.com/aspnet/AutoEventWireup.asp>

"A thing to be kept in mind is that the AutoEventWireup attribute of the Page directive is set to true by default for the machine (check out the value of this attribute in the machine.config) but set to false by default for a .aspx page). So if it is missing, since by default it is true (i.e., at the machine level), the page framework calls page events automatically, specifically the Page_Init and Page_Load methods. "

Permalänk: https://www.webforum.nu/p/1912163

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/154953-autoeventwireup-true-eller-false
