[問題] ASP.NET 關於content page的update panel

看板Web_Design作者 (千里之外)時間11年前 (2014/10/10 08:09), 編輯推噓3(305)
留言8則, 4人參與, 最新討論串1/1
爬了一些文發現... 已在master page使用scriptmanager的情況下, 在content page中可不必再加入scriptmanager, 但因為我在content page中想放一個update panel的區域, 打算用timer來做內容的更新,發現怎麼試都不會有變化?? 不知是哪裡有錯!? 首先在content page內插入一段 <asp:updatepanel ....> <contentTemplate> <asp:Label ......></asp:Label> </contentTemplate> <Triggers> <asp:AsyncPostBakTrigger: ControlID="Timer1" EventName="tick" /> </Triggers> </asp:updatepanel> c#程式碼 protected void Timer1_Tick(object sender, EventArgs e) { this.Label1.Text = DateTime.Now.LongTimeString(); } 想要在content page中看到時間的變化,但始終不變? 可否請各位大大指點迷津..謝謝!! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.136.144.60 ※ 文章網址: http://www.ptt.cc/bbs/Web_Design/M.1412899758.A.389.html

10/10 08:24, , 1F
那你有爬updatepanel的文嗎?
10/10 08:24, 1F

10/10 12:38, , 2F
你的timer放在哪裡?
10/10 12:38, 2F

10/10 21:08, , 3F
樓上大大,我放在content page內,在update panel外
10/10 21:08, 3F

10/10 21:09, , 4F
及update panel內contentTemplate內都試過,都不行!
10/10 21:09, 4F

10/10 21:53, , 5F
請問這位溫拿,能直接給code嗎?
10/10 21:53, 5F

10/11 02:06, , 6F
用ajax做比較方便
10/11 02:06, 6F

10/11 17:50, , 7F
謝謝B大關心,我剛寫完一個sample code發現可以,剛
10/11 17:50, 7F

10/11 17:50, , 8F
debug發現是我寫的ajax某些部份有問題導致此情況。
10/11 17:50, 8F
文章代碼(AID): #1KDoEkE9 (Web_Design)