62,051
社区成员
发帖
与我相关
我的任务
分享
<div id="search">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<input id="query" size="40" maxlength="2048" value="" type="text" runat="server" />
<asp:Button ID="SearchButton" runat="server" Text="Search" onclick="Search_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ul:textShow ID="Show1" runat="server" /> ///主要用于显示一些基本信息
</ContentTemplate>
</asp:UpdatePanel>
protected void Page_Load(object sender, EventArgs e)
{
Button bt = (Button)this.Head1.FindControl("SearchButton"); //Head1是一个自定义控件
bt.Click += new EventHandler(bt_Click);
}
void bt_Click(object sender, EventArgs e)
{
TextBox tb = (TextBox)this.Head1.FindControl("UpdatePanel1").FindControl("query");
if (tb.Text.Equals("") || tb.Text.Equals(null))
{
return;
}
else
{
USStock.code = tb.Text;
}
UpdatePanel up = (UpdatePanel)this.WidgetTabHost.FindControl("WidgetBodyUpdatePanel");//WidgetTabHost,自定义控件
up.Update();
}