[問題] 網頁生命週期執行時機的問題
我在aspx的<head>裡放了一段
<script>alert('1')</script>
aspx.cs的Page_Load裡放了一段
ScriptManager.RegisterStartupScript
(this.Page, this.Page.GetType(), "MSG", " alert('2');", true);
我在aspx的<body>裡又放了一段
<script>alert('3')</script>
網頁執行後彈跳視窗依序出現1 -> 2 -> 3
所以使用者收到iis回應的html後
會先執行head的內容
在進行所謂的網頁生命週期的步驟
生命週期跑完後再執行body裡面的內容
簡單來說就是網頁生命週期是在head產出後才開始進行
請問我這樣的說法對嗎?
請大大指教 謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.251.163.97
※ 文章網址: https://www.ptt.cc/bbs/C_Sharp/M.1484618771.A.4A1.html
※ 編輯: wwe90425 (60.251.163.97), 01/17/2017 10:08:09
→
01/17 13:02, , 1F
01/17 13:02, 1F
→
01/17 17:07, , 2F
01/17 17:07, 2F
→
01/17 17:07, , 3F
01/17 17:07, 3F
→
01/17 17:08, , 4F
01/17 17:08, 4F
→
01/17 17:09, , 5F
01/17 17:09, 5F
→
01/17 17:09, , 6F
01/17 17:09, 6F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章