日期:2014-05-18  浏览次数:20454 次

谁能帮我看看见鬼了 这句话怎么不对
<script   lanuage= "vb "   runat= "server ">
sub   page_load(sender   as   object,e   as   Eventargs)
if   (session( "user_name ")==Null   ||   session( "user_roles ") <> 1   )   then
{
response.write( " <script> window.open( 'login.aspx ') </script> ")
response.end
}
end   if
end   sub
</script>
爆错为==========================================================
编译器错误信息:   BC30081:   “If”必须以匹配的“End   If”结束。

源错误:

 

行   3:     <script   lanuage= "vb "   runat= "server ">
行   4:     sub   page_load(sender   as   object,e   as   Eventargs)
行   5:     if   (session( "user_name ")==Null   ||   session( "user_roles ") <> 1   )   then
行   6:     {
行   7:     response.write( " <script> window.open( 'login.aspx ') </script> ")
                    }

 


------解决方案--------------------
if isdbnull(session( "user_name ")) or session( "user_roles ")!=1 then

response.write( " <script> window.open( 'login.aspx '); </script> ")
response.end

end if

仔细比较一下

---------------
VB有 != 这样的运行符吗?!