首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

BC30289: Statement cannot appear within a method body. End of method assumed

2014-01-28 
在ASP中 function SayErr(err_str,str1) response.write script languagejavascript if err_str

在ASP中
function SayErr(err_str,str1)
response.write " <script language=javascript> "
if err_str <> " " then
response.write "alert( ' "&err_str& " '); "
end if
if trim(str1)= " " then
response.write "if(history.length==0){opener= 'kingneed ';window.close()}else{history.back();} </script> "
else
response.write "location= ' "&str1& " '; </script> "
end if
response.end
end function
是可以运行的
但是我在.NET中改成这样
function SayErr(err_str,str1)
response.write( " <script language=javascript> ")
if err_str <> " " then
response.write( "alert( ' "&err_str& " '); ")
end if
if trim(str1)= " " then
response.write( "if(history.length==0){opener= 'kingneed ';window.close()}else{history.back();} </script> ")
else
response.write( "location= ' "&str1& " '; </script> ")
end if
response.end
end function
提示我出错:Compiler Error Message: BC30289: Statement cannot appear within a method body. End of method assumed
不知道这句是什么意思!

------解决方法--------------------------------------------------------
<script runat=server>
function SayErr(err_str as string,str1 as string)
response.write( " <script language=javascript> ")
if err_str <> " " then
response.write( "alert( ' "&ctype(err_str,string)& " '); ")
end if
if trim(str1)= " " then
response.write( "if(history.length==0){opener= 'kingneed ';window.close()}else{history.back();} ")
else
response.write( "location= ' "&ctype(str1,string)& " '; ")
end if
print( " </script "& "> ")
response.end
end function
</script>
还要咱家自己想出来,头疼!

        

热点排行