作者:翁向军_943 | 来源:互联网 | 2022-12-02 18:06
我正在努力alpha.dubaiexporters.com
.有一个搜索面板包含两个输入关键字和类别.我想验证关键字部分.
如果用户输入少于三个字符并单击"搜索"按钮,则应显示客户端消息the entered input should be more than 3 characters
.我没有收到客户留言.
以下是我的代码:
以下是我的Javascript:
代码背后:
protected void doit(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtkeyword.Value))
{
try
{
String mainsearch1 = null;
mainsearch1 = txtkeyword.Value.Trim();
if (mainsearch1.Length > 2)
{
Response.Redirect("searchmain.aspx?mainsearch=" + mainsearch1 + "&querylevel=1");
}
}
catch (Exception ex)
{
}
}
else if (!string.IsNullOrEmpty(txtserach.Value))
{
try
{
String cat = null;
cat = txtserach.Value.Trim();
if (cat.Length > 2)
{
Response.Redirect("searchcat1.aspx?cat=" + cat);
}
}
catch (Exception ex)
{
}
}
}
}
我不知道为什么它不调用Javascript函数.
预期输出:当用户在txtkeyword
文本框中输入少于三个字母时,我想要此警报消息.