代码是这样的:
<%@  codepage="65001" language="VBScript" %>
<% Option Explicit %>
<!-- #include file="ckeditor/ckeditor/ckeditor.asp" -->
<%
   if session("login")=1 then
   msg=session("username")&"欢迎你~"
   msg3="<a href=tccheck.asp>"&"退出登陆"
   end if
%>
</head>
<body>
<table width="100%" border="0" align="center">
  <tr>
    <td height="26" colspan="2"><table width="320" border="0" align="left">
      <tr>
        <td width="314">&nbsp;</td>
      </tr>
    </table>    </td>
    <td width="362" height="26"><table width="375" border="0" align="right">
      <tr>
        <td width="222"><%=msg%></td>
        <td width="143"><%=msg3%></td>
      </tr>
      
    </table></td>
  </tr>
</table>错误说我msg没有定义。高手帮帮忙。。

解决方案 »

  1.   


    if session("login")=1 ... end if
    //你的写法只有session("login")为1时,才有定义,不为1时,你都没有执行msg=...,此时msg和msg3还会有定义么???
      

  2.   

    这是我的跳转页面。我在上一张页面里已经确定了session("login")为1,不为1进不了这张页面的。这样也有关系么?
      

  3.   

    <%
       if session("login")=1 then
       msg=session("username")&"欢迎你~"
       msg3="<a href=tccheck.asp>"&"退出登陆"
       else
       msg=""
       msg3=""
       end if
    %>
    我把代码改成这样了。可是还是不行还是这个错误。
      

  4.   

    <% Option Explicit %>
    问题解决了,原来是这句话,貌似意思是强制定义,删掉就好了