下邊兩個函數為何總是提示第二個中缺少end if 呢?
sub page_load(sender as object, e as eventargs)
if not ispostback then
dim conn as sqlconnection =  new  sqlconnection()
conn.connectionstring="Server=k987;Database=oa;Trusted_Connection=true" 
    conn.open() 
 else
 response.Write("hello")
end if
end sub
sub saveclick(sender as object, e as System.Web.UI.ImageClickEventArgs)
if session("userid")="" then
dim conn as sqlconnection =  new  sqlconnection()
conn.connectionstring="Server=k987;Database=oa;Trusted_Connection=true" 
    conn.open() 
dim sql as string
sql="insert into db_mynote(empid,content) values('"+session("userid")+"','"+txtcontent.text+"')"
dim cmd as sqlcommand= new sqlcommand(sql,conn)
cmd.executenonquery()
response.Redirect("mynote.aspx")
else
Response.Write("<script language='javascript'>window.open(Register.aspx','Target');</script>")
end if
end sub