asp.net(VB)遇到一个问题,请大家帮我看看。
<html>
<form runat=server>
<asp:textbox id="textbox1" runat=server/>
<asp:button id="button1" runat=server onclick="button1_click" text="发送"/>
<asp:DropDownList id="DrpFace" OnSelectedIndexChanged="DrpFace_Select" AutoPostBack=true runat="server">
<asp:ListItem Selected=true>无表情</asp:ListItem>
<asp:ListItem>表情1</asp:ListItem>
<asp:ListItem>表情2</asp:ListItem>
<asp:ListItem>表情3</asp:ListItem>
<asp:ListItem>表情4</asp:ListItem>
<asp:ListItem>表情5</asp:ListItem>
<asp:ListItem>表情6</asp:ListItem>
<asp:ListItem>表情7</asp:ListItem>
<asp:ListItem>表情8</asp:ListItem>
<asp:ListItem>表情9</asp:ListItem>
<asp:ListItem>表情10</asp:ListItem>
<asp:ListItem>表情11</asp:ListItem>
<asp:ListItem>表情12</asp:ListItem>
<asp:ListItem>表情13</asp:ListItem>
<asp:ListItem>表情14</asp:ListItem>
</asp:DropDownList>
<asp:Label id="LabFace" runat="server"> </asp:Label>
姓名:
<asp:textbox id="textbox2" runat=server/>
<asp:DropDownList id="DrpImg" Visible=false Runat=server>
<asp:ListItem> </asp:ListItem>
<asp:ListItem><img src=image/e1.gif></asp:ListItem>
<asp:ListItem><img src=image/e2.gif></asp:ListItem>
<asp:ListItem><img src=image/e3.gif></asp:ListItem>
<asp:ListItem><img src=image/e4.gif></asp:ListItem>
<asp:ListItem><img src=image/e5.gif></asp:ListItem>
<asp:ListItem><img src=image/e6.gif></asp:ListItem>
<asp:ListItem><img src=image/e7.gif></asp:ListItem>
<asp:ListItem><img src=image/e8.gif></asp:ListItem>
<asp:ListItem><img src=image/e9.gif></asp:ListItem>
<asp:ListItem><img src=image/e10.gif></asp:ListItem>
<asp:ListItem><img src=image/e11.gif></asp:ListItem>
<asp:ListItem><img src=image/e12.gif></asp:ListItem>
<asp:ListItem><img src=image/e13.gif></asp:ListItem>
<asp:ListItem><img src=image/e14.gif></asp:ListItem>
</asp:DropDownList>
</form>
<script language="vb" runat="server">
sub button1_click(sender as object,e as eventargs)
if textbox1.text="" and session("empty")=1 then
application("sender")="**" & textbox2.text & "**发言不能为空!!!<br>" & application("sender")
session("empty")=0
exit sub
end if
if session("warning")=textbox1.text and session("true")=1 and textbox1.text<>"" then
application("sender")="请**" & textbox2.text & "**不要重复发言!!!<br>" & application("sender")
session("true")=0
elseif session("warning")<>textbox1.text and textbox1.text<>"" then
session("true")=1
session("empty")=1
session("warning")=textbox1.text
application("sender") =textbox2.text & "(" & Format(Now(), "hh:mm:ss") & "):" & textbox1.text & " " &
DrpImg.Items(DrpFace.SelectedIndex).ToString & "<br>" & application("sender")
textbox1.text=""
end if
Response.Write("<script language=javascript>parent.top.location.reload();</script>")
'----------------------------问题在这里---------------------------------------
'为了刷新上面的显示发言窗口,我加了这句,但是出现错误,错误信息我贴在最下面了,不加这句,则没有错误,但是发言过后不能刷新上个窗口
'请问大家有没有更好的方法?解决立即结贴。
'-----------------------------问题结束-------------------------------------------
end sub
sub DrpFace_Select(sender as object,e as eventargs)
LabFace.text=DrpImg.Items(DrpFace.SelectedIndex).ToString
end sub
</script>
'---------------错误信息---------------------------------------------
“/net”应用程序中的服务器错误。
--------------------------------------------------------------------------------
编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。
编译器错误信息: BC30456: “DrpFace_Select”不是“ASP.chatMain_aspx”的成员。
源错误:
行 6: <asp:button id="button1" runat=server onclick="button1_click" text="发送"/>
行 7:
行 8: <asp:DropDownList id="DrpFace" OnSelectedIndexChanged="DrpFace_Select" AutoPostBack=true runat="server">
行 9: <asp:ListItem Selected=true>无表情</asp:ListItem>
行 10: <asp:ListItem>表情1</asp:ListItem>
源文件: G:\studyWeb\asp_net\chat\chatMain.aspx 行: 8
显示详细的编译器输出:
C:\WINNT\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\vbc.exe" /t:library /utf8output /R:"c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\winnt\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\winnt\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\net\e75386d8\c9f2dd7d\oo6fvfmx.dll" /debug- "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\net\e75386d8\c9f2dd7d\oo6fvfmx.0.vb"
Microsoft (R) Visual Basic .NET 编译器版本 7.10.3052.4
用于 Microsoft (R) .NET Framework 版本 1.1.4322.573
版权所有 (C) Microsoft Corporation 1987-2000。保留所有权利。
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\net\e75386d8\c9f2dd7d\oo6fvfmx.0.vb(297) : error BC30289: 语句不能出现在方法体内。假定已到达方法末尾。
Public Sub New()
~~~~~~~~~~
G:\studyWeb\asp_net\chat\chatMain.aspx(8) : error BC30456: “DrpFace_Select”不是“ASP.chatMain_aspx”的成员。
AddHandler __ctrl.SelectedIndexChanged, AddressOf Me.DrpFace_Select
~~~~~~~~~~~~~~~~~
G:\studyWeb\asp_net\chat\chatMain.aspx(65) : error BC30648: 字符串常数必须以双引号结束。
Response.Write("<script language=javascript>parent.top.location.reload();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~