What is AutoWiredUp=false in PAGE directive in ASP.NET? Microsoft documentation says default value for AutoWiredUp is TRUE, but in reality it is FALSE by default whenever we add new web page. What is it actually?

Showing Answers 1 - 2 of 2 Answers

Anilkumar Mantena

  • Jul 24th, 2006
 

AutoEventWireUP is the attribute which indicates that Visual Studio .NET will connect all event handlers explicitly using delegate code.  Microsoft Documentation says that it is "true" by default, because when you want to write an event for a particular controls, one should double click on it.  Then the delegate declaration is automatically added to the Page Initialization code and also an event to fire.  But in reality it is set of "false" when u see the page directive (in html view).  Because if you add any control in HTML view and wants to fire an event -

For example, You have created on Command Button ("CmdSubmit") with the help of <asp:Button id="CmdSubmit" Text="Submit" runat="Server">.  When you want to write code when the button is clicked, you have to add another attribute OnClick="CmdSubmit_Click()" to the above html code.  And in code behind you need to declare and define the method with the name "CmdSubmit_Click(object Sender, System.EventArgs e)" but it won't add any delegate declaration in Page_Initialization method.

For that you need to explicitly add that delegate declaration like

this.CmdSubmit.Click+=new System.EventHandler(this.CmdSubmit_Click);

This is all about AutoEventWireUp

  Was this answer useful?  Yes

chaitanya

  • Aug 30th, 2006
 

I need more clarity.ur code is not working

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions