When I add a .aspx page or .ascx control to my website the default value that appears for the AutoEventWireup attribute in the page/control directive is true. Is there any way to change this default value (I mostly set this value to false)? So that I dont have to manually change it each time I add a page. You can call me lazy ;)
Thanks
The . aspx page inherits from the code-behind class, and the code-behind class inherits from the Page class. By default, if you are using Visual Studio . NET, a Codebehind attribute is added to the @ Page directive.
The ASP.NET page framework supports an automatic way to associate page events and methods. If the AutoEventWireup attribute of the Page directive is set to true, the page framework calls page events automatically, specifically the Page_Init and Page_Load methods.
Inline Code refers to the code that is written inside an ASP.NET Web Page that has an extension of . aspx. It allows the code to be written along with the HTML source code using a <Script> tag.
When AutoEventWireup is true , ASP.NET does not require that you explicitly bind event handlers to a page event such as Load. When AutoEventWireup is true , handlers are automatically bound to events at run time based on their name and signature.
Go to the below mentioned locations open the WebForm zip file and edit the page and put the required values
Visual Studio 9
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\CSharp\Web\1033<br/>
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\Web\VisualBasic\1033
Visual Studio 8
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplatesCache\Web\CSharp\1033<br/>
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplatesCache\Web\VisualBasic\1033
[edit]
You can have further control by removing this directive from here and just enabling or disabling them from web.config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With