I am using Windows Server 2008 to deploy a website based on ASP.NET.
This websited contains a simple "DropdownList" and a "Label", when the index of "DropdownList" is changed, the text of "Label" is changed. The codes are as follows:
Default.aspx:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Value="0">Disabled</asp:ListItem>
<asp:ListItem Value="1">Enabled</asp:ListItem>
</asp:DropDownList>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
Default. aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Label1.Text = "DropdownList changes!";
}
It works fine using Visual Studio 2008 ASP.NET Development Center(e.g. http://localhost:2837/Default.aspx) , when the dropdownlist's index changes, the label's text changes as well.
However, when the web application is deployed under IIS 7, error occurs.When the dropdownlist's index changes, the label's text does not change at all.
I just using the Default Web Site->add application(Classic .NET AppPool) and where is the problem?