将.Text的原有站内搜索替换为Google站内搜索!
<script language="JavaScript">
function SearchGoogle(key,evt)
{
if(evt.keyCode==13 || evt.keyCode==0)
{
var keystr = encodeURIComponent(key.value);
url = "http://www.google.com/search?q=";
url = url+keystr;
url += "&ie=UTF-8&oe=GB2312&hl=zh-CN&domains=你的域名&sitesearch=你的域名";
window.location=url;
return;
}
}
</script>
<input style="WIDTH: 130px" type="text" name="q" onkeydown="SearchGoogle(q,event)"> <input onclick="SearchGoogle(q,event)" type="button" value="搜索" name="sa">
function SearchGoogle(key,evt)
{
if(evt.keyCode==13 || evt.keyCode==0)
{
var keystr = encodeURIComponent(key.value);
url = "http://www.google.com/search?q=";
url = url+keystr;
url += "&ie=UTF-8&oe=GB2312&hl=zh-CN&domains=你的域名&sitesearch=你的域名";
window.location=url;
return;
}
}
</script>
<input style="WIDTH: 130px" type="text" name="q" onkeydown="SearchGoogle(q,event)"> <input onclick="SearchGoogle(q,event)" type="button" value="搜索" name="sa">
只需将以上这段代码替换掉原来SearchForm.ascx的代码,并将后台代码删掉,重新再编译一次就可以了!