how to search asp.net textbox value in google ? [Resolved]

Posted by Hariinakoti under ASP.NET on 8/14/2012 | Points: 10 | Views : 1789 | Status : [Member] | Replies : 2
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



Responses

Posted by: Hariinakoti on: 8/16/2012 [Member] Starter | Points: 25

Up
0
Down

Resolved
protected void btnsearch_Click(object sender, EventArgs e)
{
try
{
string name = string.Empty;
StringBuilder queryaddress = new StringBuilder();
queryaddress.Append("http://google.com/search?q=");
if (txtsearch.Text != string.Empty)
{
name = txtsearch.Text.Replace(' ', '+');
queryaddress.Append(name + ' ' + '+');
}
string url = queryaddress.ToString();
Response.Redirect(url, false);
}

catch (Exception ex)
{
Response.Redirect(ex.ToString());
}
}

Thanks & Regards
Hari

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 8/16/2012 [Member] Starter | Points: 25

Up
0
Down
I got solution..

Thanks & Regards
Hari

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response