网络编程
位置:首页>> 网络编程>> Asp编程>> 如何正确显示模式对话框showModalDialog中的中文?

如何正确显示模式对话框showModalDialog中的中文?

  发布时间:2010-06-28 18:24:00 

标签:showModalDialog,对话框,中文

如何正确显示模式对话框中的中文?

msg.htm
   

<html>
    <head>
    <meta NAME="GENERATOR" Content="Microsoft FrontPage 3.0">
    <meta HTTP-EQUIV="Content-Type" content="text/html;
     charset=gb_2312-80">
    <title>精彩春风之MsgBox应用</title>
    </head>
    <script langauge="javascript">
    function message(title,msg,type)
    {
    var ret=0;
    ret=showModalDialog(
    "msg.asp?itle="+title+"&msg="+msg+"&type="+type,
    "","dialogWidth:30;dialogHeight:8;center:1")
    return ret
    }
    // 此函数将调用方法简化,更象系统的MSGBOX
    </script>
    <body>
    <form method="POST" action="../_vti_bin/shtml.dll/msg/test.asp" webbot-action="--WEBBOT-SELF--">
    <p><input type="button" value="test" name="cmdTest1" language="javascript"
        onclick="alert(message('title','message is here',2))"></p>
    </form>
    </body>
    </html>

msg.asp

<%@ LANGUAGE="VBSCRIPT" %>
    <%
    dim title
    dim msg
    dim itype
    title=request("title")
    msg=request("msg")
    itype=request("type")
    %>
   
    <html>
    <head>
    <meta NAME="GENERATOR" Content="Microsoft FrontPage 3.0">
    <meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb_2312-80">
    <title><%=title%></title>
    </head>
    <body language="javascript" onload="window.returnValue=0" topmargin="0" leftmargin="0" bgcolor="#000000" text="#FFFF00">
    <table border="0" cellpadding="0" width="100%" cellspacing="0">
    <tr>
    <td width="100%"><p align="center"><br><%=msg%><br>
    <br>
    <%if itype=0 then
         response.write "<input type='button' value='确定' name='cmdOk' onclick='window.returnValue=1;window.close()'>"
      elseif itype=1 then
        response.write "<input type='button' value='确定' name='cmdOk' onclick='window.returnValue=1;window.close()'>&nbsp;&nbsp;"
        response.write "<input type='button' value='取消' name='cmdCANCEL' onclick='window.returnValue=0;window.close()'>"
    elseif itype=2 then
        response.write "<input type='button' value='是' name='cmdYes' onclick='window.returnValue=1;window.close()'>&nbsp;&nbsp;"
        response.write "<input type='button' value='否' name='cmdNo' onclick='window.returnValue=0;window.close()'>"
    end if%>
    </td>
    </tr>
    </table>
    </body>
    </html>

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com