Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a website in which i want to implement google search
I had written code as

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<form id="form1" runat="server" method="get" action="http://www.google.com/search">
    
  <input type="text" id="field" name="q" size="25" style="width: 140px; height: 30px; background-color: Transparent; border-color: Transparent; border-style: none; border-width: 0px"
maxlength="255" value="Google site search" onfocus="if(this.value==this.defaultValue)this.value=''; this.style.color='black';"  önblur="if(this.value=='')this.value=this.defaultValue; " />
                                       

 <input type="hidden" name="sitesearch" value="http://data-pointonline.com/" />

 </form>



    <script type="text/javascript">  $(function () {
      $("#field").keyup(function (event) {
          if (event.which == 13) {
              document.myform.submit();
          }
      });
  });

</script>



The code above is working but the problem is the header and footer of the master page are not present,i want google search with out losing the header and footer .what extra editing should i have to do to the above code to accomplish my requirment.Please help.
Posted













Kishor Makwana
Software Engineer
Insight Softech
www.insightsoftech.com
 
Share this answer
 
Comments
aassaahh 14-Jun-13 4:26am    
how to create <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxx:u3qsil-l6ut" />
partner pub id










Kishor Makwana
Software Engineer
Insight Softech
www.insightsoftech.com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900