作者Madoc (晴天)
站內Ajax
標題[問題] alert警告視窗
時間Tue Apr 14 14:14:11 2009
請問各位大大 高手們..
我要在aspx中寫警告視窗
使用了alert
不過跑不出來~
想請教有沒有比較好的視窗方法
並請指正我錯誤的地方... 感激不盡~
If a > b Then
ErrMsg.Visible = True
ErrMsg.Text = ("<script> alert(' 輸入錯誤 ');")
End If
--
新手上路QQ
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.214.97
1F:推 ourear:("<script> alert(' 輸入錯誤 ');</script>") 04/14 14:46
2F:→ Madoc:謝謝~不過還是沒有視窗出現說..@@a 我還有哪邊有錯誤的嗎.. 04/14 17:22
3F:→ TonyQ:要不要設一下break point 看看是不是根本沒跑到? 04/14 19:00
4F:→ TonyQ:不然看看產出來的網頁原始碼有沒有出現. 04/14 19:00
5F:→ humanfly:msgbox也可以,一定要用javascript? 而且你語法為啥要 04/14 20:39
6F:→ humanfly:放在.text裡面? 04/14 20:39
7F:推 fannys23:你的 ErrMsg 是 Label 還是 Literal? @@a 04/14 20:48
8F:→ Madoc:是Label @@ 04/14 23:02
9F:推 grence:Label好像會自動跳脫html tag,用RegisterStartupScript 04/15 03:52
10F:→ fannys23:或者把 label 改成 literal 試看看,literal 是純文字 04/15 08:12
11F:→ TonyQ:問題應該不是出在label (這應該看html source就能確定.) 04/15 15:01
12F:→ fannys23:我實驗了一下,在 label 真的可以做得出來耶。 04/15 22:16
13F:→ fannys23:我原本想法是 grence 說的,我認為 label 會把 html tag 04/15 22:18
14F:→ fannys23:視為是一般的文字(類似<變成<之類的...) 04/15 22:19
15F:→ fannys23:所以goto推文第三行:設中斷點看 if 判斷成功了沒 XD 04/15 22:20