ASP.NET page_init event?

后端 未结 7 1425
梦谈多话
梦谈多话 2021-02-01 17:52

I am using ASP.NET 3.5 and i used earlier 1.1 i am having difficulty to find where can i attach/declare the page init event ?

In 1.1 there was auto generated code which

7条回答
  •  [愿得一人]
    2021-02-01 18:13

    you can add the page_init method in page's CS file. For example, if you have Default.aspx you can put the method in Default.aspx.cs

    When you create a page in VS you will have the Page_Load method created for you. You can put your page_init code & other code for the page int the CS file.

    PS: If you use VB as the server side code, you will have to put it in the VB file

提交回复
热议问题