如何在Google搜索中搜索我们的asp.net文本框值? [英] how to search our asp.net text box value in google search?

查看:71
本文介绍了如何在Google搜索中搜索我们的asp.net文本框值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,
如何在Google搜索中搜索我们的asp.net文本框值?
如果我们在该文本框中键入一些字符串,然后在google中搜索该字符串.

谢谢与问候
Hari

hi friends,
how to search our asp.net text box value in google search?
If we type some string in that textbox and search that string in google.

Thanks & Regards
Hari

推荐答案

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body><form name="mysearch" action="http://www.google.com/search" method="get" onSubmit="sitesearch(this)">

<input id="hiddenquery" type="hidden" name="q" />
<input name="qfront" type="text" style="width: 200px" value="navigator object" /> <input type="submit" value="Search" /><br />
<div style="font: bold 11px Verdana;">Google:<input name="se" type="radio" checked>  Yahoo:<input name="se" type="radio">  MSN:<input name="se" type="radio">
</div>

<script type="text/javascript">



//Enter domain of site to search.
var domainroot="www.codeproject.com/"

var searchaction=[ //form action for the 3 search engines
"http://www.google.com/search",
"http://search.yahoo.com/search",
"http://search.msn.com/results.aspx"
]

var queryfieldname=["q","p","q"] //name of hidden query form for the 3 search engines

function switchaction(cur, index){
cur.form.action=searchaction[index]
document.getElementById("hiddenquery").name=queryfieldname[index]
}

function sitesearch(curobj){
for (i=0; i< document.mysearch.se.length; i++){ //loop through radio to see which is checked

if (document.mysearch.se[i].checked==true)

switchaction(document.mysearch.se[i], i)

}

document.getElementById("hiddenquery").value="site:"+domainroot+" "+curobj.qfront.value

}





</script>

</p>

</form>

<p style="font: normal 11px Arial">Search all in one<br />
<a href="http://www.facebook.com/premprakashparihar">prem prakash</a></p>
</body>
</html>


请参阅我对问题的评论.如果您需要它,请在此处进行完整说明:
https://developers.google.com/custom-search/v1/getting_started [ ^ ].

—SA
Please see my comment to the question. If this is what you need, it is fully described here:
https://developers.google.com/custom-search/v1/getting_started[^].

—SA


这篇关于如何在Google搜索中搜索我们的asp.net文本框值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆