<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</div>这到底是为什么嫩?
我囧了,你有木有?
解决方案 »
- 不用updatepanel怎么刷新gridview
- 我做的网页用户登录后,用户id和权限都能显示出来,我想求一个加密解密的例子。c#的。谢谢
- 都来看看,简单登陆代码
- 这里的 using WebClassOne; 是什么意思,从那里来的?
- 请教诸位,DataGrid中给某几项定义鼠标右键功能,如何实现?
- 无法在 Web 服务器上开始调试
- 我设置了调试状态,可是为什么不让我调试?
- DataGrid 的模板列里找控件的问题,查了半天也找不到答案
- 哪里有数据库基础概论 或数据库概论 的电子书 谢谢~今天刚涨了10分 就10分了
- 一个vb简单的除法命令
- vs2010界面与运行后偏差很大(跑位了),有什么方法恢复?
- asp.net与sql server 2008
<%@ Page Language="C#" Inherits="VPage" %><script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.Calendar1.Style["position"] = "absolute";
this.TextBox1.DataBind();
}
} protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.DropDownList2.Items.Clear();
switch (this.DropDownList1.SelectedValue)
{
case "北京":
this.DropDownList2.Items.Add("天安门广场");
this.DropDownList2.Items.Add("颐和园");
this.DropDownList2.Items.Add("雍和宫");
this.DropDownList2.Items.Add("红螺寺");
break;
case "上海":
this.DropDownList2.Items.Add("崇明岛");
this.DropDownList2.Items.Add("外滩");
this.DropDownList2.Items.Add("万佛阁");
break;
case "香港":
this.DropDownList2.Items.Add("海洋公园");
this.DropDownList2.Items.Add("半岛酒店");
break;
}
}
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
ShowResult();
} protected void Button1_Click(object sender, EventArgs e)
{
if (this.Calendar1.Visible)
SetupTheDate();
else
{
try
{
this.Calendar1.SelectedDate = DateTime.Parse(this.TextBox1.Text);
this.Calendar1.VisibleDate = this.Calendar1.SelectedDate;
}
catch
{
}
this.Calendar1.Visible = true;
}
} protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
SetupTheDate();
} private void SetupTheDate()
{
this.TextBox1.Text = this.Calendar1.SelectedDate.ToShortDateString();
this.Calendar1.Visible = false;
ShowResult();
} void ShowResult()
{
this.Label1.Text = "您选择" + this.TextBox1.Text + "去" + this.DropDownList2.SelectedValue;
UpdatePanel3.Update();
}
</script>
<!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 id="Head1" runat="server">
<title>在开发ajax应用初期应该使用基本的asp.net ajax功能</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>北京</asp:ListItem>
<asp:ListItem>上海</asp:ListItem>
<asp:ListItem>香港</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged" />
</ContentTemplate>
</asp:UpdatePanel>
<br />
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
请输入日期:
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:TextBox ID="TextBox1" runat="server" Width="147px" Text="<%# DateTime.Now.AddDays(20).ToShortDateString() %>" />
<asp:Button ID="Button1" runat="server" Text="..." OnClick="Button1_Click" />
</td>
</tr>
<tr>
<td>
<asp:Calendar ID="Calendar1" runat="server" Visible="False" OnSelectionChanged="Calendar1_SelectionChanged"
BackColor="#FFFFCC" BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest"
Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px" ShowGridLines="True"
Width="220px">
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<SelectorStyle BackColor="#FFCC66" />
<TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#CC9966" />
<NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
<DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" ForeColor="#FFFFCC" />
</asp:Calendar>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<hr />
<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
<ContentTemplate>
result:
<asp:Label ID="Label1" runat="server" EnableViewState="False" Font-Size="Small"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>