复制代码 代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test2.aspx.cs" Inherits="test2" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>DropDownExtender简单练习</title>
<style type="text/css">
#Panel1
{
background:#ffcc00;
font-size:12px;
padding:0px;
border:solid 1px;
}
#LinkButton1,#LinkButton2,#LinkButton3,#LinkButton4
{
color:#666;
font-size:12px;
}
</style>
</head>
<body>
<form runat="server">
<div>
<asp:ScriptManager runat="server">
</asp:ScriptManager>
</div>
<br />
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Label runat="server" Text="Label"></asp:Label><br />
<br />
<asp:Label runat="server" Text="请选择"></asp:Label>
<asp:Panel runat="server">
<asp:LinkButton runat="server">西安</asp:LinkButton><br />
<asp:LinkButton runat="server">上海</asp:LinkButton><br />
<asp:LinkButton runat="server">深圳</asp:LinkButton><br />
<asp:LinkButton runat="server">北京</asp:LinkButton></asp:Panel>
<cc1:DropDownExtender runat="server" DropDownControlID="Panel1"
TargetControlID="Label1">
</cc1:DropDownExtender>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
复制代码 代码如下:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class test2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void lkbtn_Click(object sender, EventArgs e)
{
Label1.Text = ((LinkButton)sender).Text;
Label2.Text = Label1.Text;
}
}
新闻热点
疑难解答
图片精选