Sunday, April 18, 2010

How to Use Google Search In

How to Use Google Search In

To Use google Search In Your Application

First Take One Seach Page And Button

And Craete HTML Page "Search.aspx" and Use Below Code In It
[form id="formsearch? runat="server"]


[asp:Label ID="lblsearch" runat="server" Width="120px"]Google Search…[/asp:Label][br /]

[asp:Label ID="lblmsg? runat="server" ][/asp:Label]

[asp:TextBox ID="txtseach" runat="server" Height="19px" Width="293px" ][/asp:TextBox]

[asp:Button ID="btnsearch" runat="server" Text="Search Google" Height="25px" OnClick="btnsearch_Click" Width="137px" /]



Write Below Code In Btn Event Of btnSearch in search.aspx.cs
protected void  btnsearch_Click(object sender, EventArgs e)
if (txtseach.Text.Trim().Length == 0)
lblmsg.Text = "Please enter text to search";
Response.Redirect("" + txtseach.Text);

Action Method in Mvc

In this section, you will learn about the action method of controller class. All the public methods of a Controller class are called Act...