AutoEventWireUp Usage with Example

P

prem

Hi ,
Any one please give me the Usage with example for
AutoEventWireUp PageDirective.

Regards,
Prem.
 
S

Saravana

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. In that case, no explicit
Handles clause or delegate is needed.

The disadvantage of the AutoEventWireup attribute is that it requires that
the page event handlers have specific, predictable names. This limits your
flexibility in how you name your event handlers. Therefore, in Visual
Studio, the AutoEventWireup attribute is set to false by default and the
designer generates explicit code to bind page events to methods.

If you do set AutoEventWireup to true, Visual Studio will generate code to
bind the events and the page framework will automatically call events based
on their names. This can result in the same event code being called twice
when the page runs.
 

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,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top