关于搜索按钮与搜索栏之间的问题
怎么设置“搜搜看”这个按钮,当搜索栏中输入为空时,弹出提示“请输入关键字”
protected void Search_Click(object sender, EventArgs e)
{
String theSel = RadioButtonList1.SelectedValue;
if (theSel == "1")
{
Response.Redirect("ss_hp.aspx?ss=" + sstext.Text.ToString());
}
else
{
Response.Redirect("ss_hk.aspx?ss=" + sstext.Text.ToString());
}
}
}
<td colspan="2" bgcolor="#e9e9e8" align="left" valign="middle" style="padding-left:10px;">
<span class="span11"> 搜 索:</span>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" BackColor="#e9e9e8" RepeatLayout="Flow" RepeatDirection="Horizontal" RepeatColumns=2>
<asp:ListItem Selected=True Text="换物 " Value="1" />
<asp:ListItem Text="换客" Value="2" />
</asp:RadioButtonList>
<asp:TextBox ID="sstext" runat="server" Width="233px" />
<asp:Button ID="Button1" onclick="Search_Click" runat="server" Text="搜搜看" CausesValidation=false />