Default autoEventWireup changed to true?

D

Danny Tuppeny

Hi all,

Looks like autoEventWireup defaults to true in 2.0. Kinda silly if you ask
me, since the MS site says there's a performance penalty, and I can't
imagine it's something used very often!

Anyway, anyone know where to change this setting? I've set the "default" in
web.config to false, but new pages still have it coded into the page
directive as true, which overrides. I don't want to have to do a
search/replace before I publish the site every time, but I can't find any
templates for a new webform *anywhere* on my machine (though Windows search
is a bit cack ;))

Anyone know how I can *really* set this to false?

Thanks,

Danny Tuppeny
 
G

Gaurav Vaish

Go to the folder:

<VS.Net 2005>\VC#Wizards\CShapAddWebFormWiz\Templates

Update the file WebForm1.aspx

<VS.Net 2005> is the folder where you installed Visual Studio .Net 2005.



HTH

--
Cheers,
Gaurav Vaish
http://mastergaurav.org
----------------------


: Hi all,
:
: Looks like autoEventWireup defaults to true in 2.0. Kinda silly if you ask
: me, since the MS site says there's a performance penalty, and I can't
: imagine it's something used very often!
:
: Anyway, anyone know where to change this setting? I've set the "default"
in
: web.config to false, but new pages still have it coded into the page
: directive as true, which overrides. I don't want to have to do a
: search/replace before I publish the site every time, but I can't find any
: templates for a new webform *anywhere* on my machine (though Windows
search
: is a bit cack ;))
:
: Anyone know how I can *really* set this to false?
:
: Thanks,
:
: Danny Tuppeny
:
:
 
D

Danny Tuppeny

Gaurav Vaish said:
Go to the folder:

<VS.Net 2005>\VC#Wizards\CShapAddWebFormWiz\Templates

Update the file WebForm1.aspx

<VS.Net 2005> is the folder where you installed Visual Studio .Net
2005.

I don't have that folder :(
It's Visual Web Develop Express, and inside C:\Program Files\Microsoft
Visual Studio 8\VC# I have these folders:

CSharpProjects
Snippets
VCSPackages

None contain a templates folder. I found this folder:

C:\Program Files\Microsoft Visual Studio 8\Web\WebNewFileItems\CSharp

Which has a WebForm.aspx file in it, but it doesn't have an @Page directive
to change things on :-(

I also found this (a zip file):

C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\VWDExpress\ItemTemplates\Web\CSharp\1033\WebForm.zip

But the Webform.aspx inside contains only "<% @Page language="C#" %>"!

I'll have a poke around in those folders though - gotta be here somewhere!!
 
D

Danny Tuppeny

<snip>

In:

C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\VWDExpress\ItemTemplates\Web\CSharp\1033\WebForm.zip

There's a file called WebForm_cb.aspx. Also a ContentPage_cb.aspx, which is
more likely the one I'm using, so I've changed the AutoEventWireup property
in both...

No luck! :-(

grrrr
 
D

Danny Tuppeny

Danny Tuppeny said:
In:

C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\VWDExpress\ItemTemplates\Web\CSharp\1033\WebForm.zip

There's a file called WebForm_cb.aspx. Also a ContentPage_cb.aspx, which
is more likely the one I'm using, so I've changed the AutoEventWireup
property in both...

Right...

In the above path, changing ItemTemplates to ItemTemplatesCache has unzipped
versions of everything. I extracted the zip file into there, replacing the
"cache", and now, all is good.

Why they didn't just add autoEventWireup=true to the web.config and leave it
out of the template, I don't know (why it's even true, I don't know!).
Anyway, now, it doesn't exist in my page files, just web.config. How it
should be! :)
 
G

Gaurav Vaish

: Why they didn't just add autoEventWireup=true to the web.config and leave
it
: out of the template, I don't know (why it's even true, I don't know!).

Ah! I can't say much about Express. :-(
 
J

Juan T. Llibre

re:
Why they didn't just add autoEventWireup=true to the web.config and leave it out of the
template

Hi, Danny.

In the future, to prevent grief about default settings, always remember
to check the "web.config.comments" file in the CONFIG subdirectory
of the 2.0 framework directory.

That file has the default settings for all configurable web.config
properties and includes the relevant options for all of them.

For this case, it says that :
<pages autoEventWireup = "true"

and that it has the options [true|false]

best regards,
 
D

Danny Tuppeny

Juan T. Llibre said:
Hi, Danny.

In the future, to prevent grief about default settings, always remember
to check the "web.config.comments" file in the CONFIG subdirectory
of the 2.0 framework directory.

That file has the default settings for all configurable web.config
properties and includes the relevant options for all of them.

For this case, it says that :
<pages autoEventWireup = "true"

and that it has the options [true|false]

I already set the option in web.config, but any option in the page override
it, and by default, each page contains autoEventWireup="true", so without
modifying every page (or the template, as I now have), the option in
web.config is *useless* and will never be used! :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top