sanz 0 Newbie Poster

hi,i am making a website in which i have included google search engine.i want to write a code for remembering the previously searched keywords ie if user has written 'a' then all his previous searches starting with a must come in textbox.i dont want to use auto complete feature of browser.i have tried doing this with the help of cookies .actually i have tried to retrieve cookies in textbox but i am getting no result.plz help me as soon as possible i am showing code below.
thanks.

SAVING COOKIE
 protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("http://www.google.com.pk/search?hl=en&source=hp&q="+txt_searchgoogle.Text+"&aq=f&aqi=&aql=&oq=&gs_rfai=");
        HttpCookie c = new HttpCookie("keywords");
        c["text"] = txt_searchgoogle.Text;
        Response.Cookies.Add(c);
        
    }

RETREIVING COOKIE
 protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie r = Request.Cookies["keywords"];
        if (r != null)
        { txt_searchgoogle.Text = r["text"].ToString(); }
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.