主题:很奇怪的问题?懂C#的朋友请进
这段代码执行后,为什么浏览器上看不到button控件的按钮,而其它的控件都在服务端执行了,照书上做的啊,想不通啊!
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573
<script language="c#" runat="server">
void Page_Load(Object sender,EventArgs e)
{
dropdown1.Items.Add(new ListItem("ASP.Net区","ASP.Net"));
dropdown1.Items.Add(new ListItem("JSP","JSP"));
dropdown1.Items.Add(new ListItem("C#","C#"));
dropdown1.Items.Add(new ListItem("PHP","PHP"));
dropdown1.Items.Add(new ListItem("VBVC","VBVC"));
dropdown1.Items.Add(new ListItem("HTML","HTML"));
}
void submitbtnclick(Object sender,CommandEventArgs e)
{
string selectedtext=dropdown1.SelectedItem.Text;
string selectedvalue=dropdown1.SelectedItem.Value;
label1.Text="您选择的讨论区是:<font color=red>"+selectedtext+"<br></font>值为:<font color=red>"+selectedvalue+"</font>";
}
</script>
<html>
<head>
<title></title>
</head>
<body>
<b><font face="Verdana">dropdownlist示例</font></b>
<form runat=server>
<asp:DropDownList ID="dropdown1" runat="server"/>
<asp:Button id="button1" Text="选择" ruant="server"/>
<p>
<asp:label id="label1" font-size=10pt runat="server">
请选择一个讨论区
</asp:label>
</form>
</body>
</html>
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573
<script language="c#" runat="server">
void Page_Load(Object sender,EventArgs e)
{
dropdown1.Items.Add(new ListItem("ASP.Net区","ASP.Net"));
dropdown1.Items.Add(new ListItem("JSP","JSP"));
dropdown1.Items.Add(new ListItem("C#","C#"));
dropdown1.Items.Add(new ListItem("PHP","PHP"));
dropdown1.Items.Add(new ListItem("VBVC","VBVC"));
dropdown1.Items.Add(new ListItem("HTML","HTML"));
}
void submitbtnclick(Object sender,CommandEventArgs e)
{
string selectedtext=dropdown1.SelectedItem.Text;
string selectedvalue=dropdown1.SelectedItem.Value;
label1.Text="您选择的讨论区是:<font color=red>"+selectedtext+"<br></font>值为:<font color=red>"+selectedvalue+"</font>";
}
</script>
<html>
<head>
<title></title>
</head>
<body>
<b><font face="Verdana">dropdownlist示例</font></b>
<form runat=server>
<asp:DropDownList ID="dropdown1" runat="server"/>
<asp:Button id="button1" Text="选择" ruant="server"/>
<p>
<asp:label id="label1" font-size=10pt runat="server">
请选择一个讨论区
</asp:label>
</form>
</body>
</html>