IMPORTANTCan any body solve this problem?How to create pages for event handlers Init, Load, PreRender, etc. in VS 2008? When we double-click on the page, it will raise the Page_Load event. How to create othere page events? I am using C # in an ASP.NET application.There is no image on the Event tab.
Here is your answerIn the solution explorer, right-click on the page and select "View Component Designer" from the context menu, now in the properties window you will see the events tab.
:
on_xxx Web.UI.Page. private override, , Intellisense , , ( ).
private override
AutoEventWireup, true, Page_[your event] Page_Init . .
Page_[your event]
Page_Init
ASP.NET , AutoEventWireup Web Forms . AutoEventWireup @page TRUE ( , TRUE), ASP.NET ., - Page_Init Page_Load ASP.NET .AutoEventWireup , . .
ASP.NET , AutoEventWireup Web Forms . AutoEventWireup @page TRUE ( , TRUE), ASP.NET .
, - Page_Init Page_Load ASP.NET .
AutoEventWireup , . .
</" > :
</" > cheetsheet MSDN, , :
. msdn " ", , .
http://msdn.microsoft.com/en-us/library/ms178472.aspx
(, , datacontrols) #, , , .
On , override OnLoad , OnPreRender .. , :
protected override void OnInit(EventArgs e) { base.OnInit(e); //don't remove }
, :
protected void Page_Init(object sender, EventArgs e) { }
- ( ), 100%.
.
: http://msdn.microsoft.com/en-us/library/6w2tb12s%28v=VS.90%29.aspx ( VS 2008)
, Page_event.
, , Page_Load.
ASP.NET pages automatically associate page events with methods that are named Page_event. This auto-binding is set by the AutoEventWireup attribute in the @Page directive, which is set to true by default. If AutoEventWireup is set to false, the page will not automatically search for methods that use the Page_event naming convention.
Worked for me!
Source: https://habr.com/ru/post/1791695/More articles:Creating a forms application with Visual Studio without CLR / .NET - c ++Using Visual C ++ for C ++ instead of C ++ / CLI - c ++Dedicated stream (one stream per connection) with the ability to buffer (c / C ++) - c ++DotNetNuke - module settings are removed with new user control - dotnetnukeconverting mp3 to mp4 - videoСоздать объект из удаленного JSON - jsonComputing the position of an object from image processing - image-processingxcode: выбор выражений ярлык - xcodeGoogle Maps: only one window created for multiple markers - javascriptChrome JSON extension issue - jsonAll Articles