Click here to Skip to main content
15,879,613 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I have a textBox in the index page and I want it to take the value from this text to the google search engine in another page.

how can i pass this variable from control to the cse?

This is the index code for passing the variable

C#
Response.Redirect("Search.aspx?parma=" + TextBox1.Text);


and this is cse code

HTML
<div id="cse" style="width: 100%;">
        Loading</div>
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
    <script type="text/javascript">
        google.load('search', '1', { language: 'en', style: google.loader.themes.V2_DEFAULT });
        google.setOnLoadCallback(function () {
            var customSearchOptions = {}; var customSearchControl = new google.search.CustomSearchControl(
      '005855432507834898991:mcvfceuyc9m', customSearchOptions);
            customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
            customSearchControl.draw('cse');
        }, true);
    </script>
Posted

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