DropDownList控件,错哪了???
反复看几遍,还是不能运行,大家帮忙看看!先谢了!!!
<script language="C#" runat="server">
void Page_load(object src,EventArgs e)
{
DropDown1.Items.Add(new ListItem("ASP.Net区",“ASP.Net”));
DropDown1.Items.Add(new ListItem("JSP区",“JSP”));
DropDown1.Items.Add(new ListItem("PHP区",“PHP”));
DropDown1.Items.Add(new ListItem("VBVC区",“VBVC”));
DropDown1.Items.Add(new ListItem("HTML区",“HTML”));
}
void SubmitBtn_Click(object Sender,EventArgs e)
{
string SelectedText=DropDow1.SelectedItem.Text;
string SelectedValue=DropDow1.SelectedItem.Value;
Label1.Text="您选择的讨论区是:</font color=red>"+SelectedText+"<br></font>值为:<font color=red>"+SelectedValue+"</font>";
}
</script>
<html>
<head>
</head>
<body>
<b><font face="verdana">DropDownList示例</font></b>
<form ruant=server>
<asp:DropDownList id=DropDown1 runat="server"/>
<asp:button text="选择" Onclick="SubmitBtn_Click" runat=server/>
<p>
<asp:Label id=label1 font-size="10pt" runat="server">
请选择一个讨论区
</asp:Label>
</form>
</body>
</html>
报错是这样的:
Compiler Error Message: CS1026: ) expected
Source Error:
Line 4: DropDown1.Items.Add(new ListItem("ASP.Net区",“ASP.Net”));