使用dropdownlist能实现不刷新页面的效果么?具体的例子

2025-01-05 13:36:14
推荐回答(2个)
回答1:

使用updatepanel

回答2:

至少VS2008 sp1 以上

.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Temp.aspx.cs" Inherits="Temp" %>











onselectedindexchanged="DropDownList1_SelectedIndexChanged" style="width: 40px">
aa
bb






EventName="SelectedIndexChanged" />







.aspx.cs

using System;

public partial class Temp : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Label1.Text = DropDownList1.SelectedValue;
}
}