问题描述
当我添加一个.aspx页面中或控制的.ascx到我的网站出现在页/控制指令AutoEventWireup属性的默认值是true。有什么办法来改变这个默认值(我大多将该值设置为false)?让我没有我每增加一个页面的时间来手动更改。你可以叫我懒;)
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 ;)
感谢
推荐答案
转到下面提到的位置打开WebForm的zip文件并编辑页面,并把所需的值
Go to the below mentioned locations open the WebForm zip file and edit the page and put the required values
Visual Studio的9
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
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
你可以从这里删除该指令,只是启用或从web.config中禁用它们有进一步的控制。
[edit]
You can have further control by removing this directive from here and just enabling or disabling them from web.config
这篇关于设置AutoEventWireup =&QUOT;假&QUOT;默认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!