作者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