need WebMessageBox的源码.......
解决方案 »
- 我使用Ajax技术的时候,想使用JSON作为客户端和服务器端之间传递数据的格式,请问怎么使用呢?
- http 403 ForBid
- 求asp.net项目中,config.dll文件内容解释
- 关于SESSION生命周期的问题
- 如何将CSV文件导入SQL数据库??急!
- 如何控制dropdownlist下拉显示的选项数目
- 请问access中用"查询功能"做一个插入操作怎么实现
- 怎样在后台程序中控制WebForm中的<form>中的所有属性!
- 如何在Default.aspx中写HTML语言啊?
- 高分求解决Session的问题!
- 如何在页面中显示另外一个html文件的内容?
- 菜鸟50分求解:怎么读取这种XML中的信息?
控件~~~~~·发到我的邮箱吧
[email protected]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>WebDialog</title>
<style type="text/css">
<!--
td{font-size=11pt}
--></style>
<script language="javascript">
var oMyObject = window.dialogArguments;
var sTitle = oMyObject.Title;
var sMessage = oMyObject.Message;
var sButton = oMyObject.Button;
var sIcon = oMyObject.Icon;
var sColor = oMyObject.Bgcolor;
var iDefaultButton = oMyObject.DefaultButton;
try
{
window.returnValue = -1;
document.title = sTitle;
}
catch(e){} function Returnvalue(result){
window.returnValue = result;
window.close();
}
</script>
</head>
<body bgcolor="#D6D3CE" scroll="no" onload="focusbutton(iDefaultButton)" onkeydown="changeSelect()">
<p><br>
<table align="center" border="0" width="90%" height="90%" ID="Table1">
<tr>
<td>
<script language="javascript">
/* Show Icon
None
Error: Error.gif
Information: Information.gif
Question: Question.gif
Warning: Warning.gif
*/
switch( sIcon )
{
case "None":
break;
case "Error":
document.write ("<img src=\"images/Error.gif\">");
break;
case "Information":
document.write ("<img src=\"images/Information.gif\">");
break;
case "Question":
document.write ("<img src=\"images/Question.gif\">");
break;
case "Warning":
document.write ("<img src=\"images/Warning.gif\">");
break;
}
</script>
</td>
<td>
<script language="javascript">
document.write( sMessage );
</script>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<script language="javascript">
/* return value
Cancel : 0
No: 4
Abort: 5
Ok: 1
Yes: 3
Retry: 2
Ignore: 6
*/
switch( sButton )
{
case "OK":
document.write ("<input type=\"image\" src=\"images/Ok.gif\" id=\"Dialogbutton0\" style=\"cursor:hand\" onclick=\"Returnvalue(1)\"> ");
break;
case "OKCancel":
{
document.write ("<input type=\"image\" src =\"images/Ok.gif\" id=\"Dialogbutton0\" style=\"cursor:hand\" onclick=\"Returnvalue(1)\"> ");
document.write ("<input type=\"image\" src=\"images/Cancel.gif\" id=\"Dialogbutton1\" style=\"cursor:hand\" onclick=\"Returnvalue(0)\"> ");
}
break;
case "RetryCancel":
{
document.write ("<input type=\"image\" src=\"images/Retry.gif\" id=\"Dialogbutton0\" style=\"cursor:hand\" onclick=\"Returnvalue(2)\"> ");
document.write ("<input type=\"image\" src=\"images/Cancel.gif\" id=\"Dialogbutton1\" style=\"cursor:hand\" onclick=\"Returnvalue(0)\"> ");
}
break;
case "YesNo":
{
document.write ("<input type=\"image\" src=\"images/Yes.gif\" id=\"Dialogbutton0\" style=\"cursor:hand\" onclick=\"Returnvalue(3)\"> ");
document.write ("<input type=\"image\" src=\"images/No.gif\" id=\"Dialogbutton1\" style=\"cursor:hand\" onclick=\"Returnvalue(4)\"> ");
}
break;
case "YesNoCancel":
{
document.write ("<input type=\"image\" src=\"images/Yes.gif\" id=\"Dialogbutton0\" style=\"cursor:hand\" onclick=\"Returnvalue(3)\"> ");
document.write ("<input type=\"image\" src=\"images/No.gif\" id=\"Dialogbutton1\" style=\"cursor:hand\" onclick=\"Returnvalue(4)\"> ");
document.write ("<input type=\"image\" src=\"images/Cancel.gif\" id=\"Dialogbutton2\" style=\"cursor:hand\" onclick=\"Returnvalue(0)\"> ");
}
break;
case "AbortRetryIgnore":
{
document.write ("<input type=\"image\" src=\"images/Abort.gif\" id=\"Dialogbutton0\" waki=\"0\" style=\"cursor:hand\" onclick=\"Returnvalue(5)\"> ");
document.write ("<input type=\"image\" src=\"images/Retry.gif\" id=\"Dialogbutton1\" waki=\"1\" style=\"cursor:hand\" onclick=\"Returnvalue(2)\"> ");
document.write ("<input type=\"image\" src=\"images/Ignore.gif\" id=\"Dialogbutton2\" waki=\"2\" style=\"cursor:hand\" onclick=\"Returnvalue(6)\"> ");
}
}
</script>
</tr>
</table>
<script language="javascript"> function focusbutton(it)
{
try{
switch (it)
{
case "0":
if(document.all("Dialogbutton0")!=null)
document.all("Dialogbutton0").focus();
break;
case "1":
if(document.all("Dialogbutton1")!=null)
document.all("Dialogbutton1").focus();
break;
case "2":
if(document.all("Dialogbutton2")!=null)
document.all("Dialogbutton2").focus();
break;
}
}
catch(e){}; }
function changeSelect()
{
//按光标键时,改变选择按钮,37为向左键,39为向右键
try
{
if(event.keyCode==37)
switch ( document.activeElement.id )
{
case "Dialogbutton1":
document.all("Dialogbutton0").focus();
break;
case "Dialogbutton2":
document.all("Dialogbutton1").focus();
break;
} if(event.keyCode==39)
switch ( document.activeElement.id )
{
case "Dialogbutton0":
document.all("Dialogbutton1").focus();
break;
case "Dialogbutton1":
document.all("Dialogbutton2").focus();
break;
}
}
catch(e){}
}
</script>
</body>
</html>