求助!!不懂怎么回事!
<script language= "VB " runat= "server "> Sub Search_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
dim url as string
if Searchbox.text= " " then
response.Write( " <script language=javascript> ") //不要红色的代码就不会出现错误!
response.Write( "window.alert( '请输入需要查找的药品名! '); ")
response.Write( "</script>")
elseif Category.SelectedItem.Value= "default " then
url= "Search.aspx?Drugmerchant= "+Drugmerchant.SelectedItem.text
url &= "&Searchbox= "+Searchbox.text
response.Redirect(url)
elseif Category.SelectedItem.Value <> "default " then
url= "Search.aspx?Category= "+Category.SelectedItem.text
url &= "&Searchbox= "+Searchbox.text
url &= "&Drugmerchant= "+Drugmerchant.SelectedItem.text
response.Redirect(url)
End if
End Sub
</script>
出现的错误是:
编译器错误信息: BC30081: “If”必须以匹配的“End If”结束。
源错误:
行 2: Sub Search_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
行 3: dim url as string
行 4: if Searchbox.text= " " then
行 5: response.Write( " <script language=javascript> ")
行 6: response.Write( "window.alert( '请输入需要查找的药品名! ')
这些代码是写在用户控件里的!
大家帮帮忙解决!!谢了!
[此贴子已经被作者于2007-11-21 10:53:57编辑过]