I am creating a site where i want then when a user register there ... and after registration i want is...
there is a text box(for searching) and a button is there when a user (Registered) click that button the number of times when he clicked the button should be store in my database.
and i want to connect my search box to google search.
Please help its urgent
Thanks
chester
Loading

Lalit MRank #1,186 · 1.5K reputationPosted Nov 15, 2009, 9:04 PM EST
protected void _btnSearch_Click (Object sender, EventArgs e) { if (!IsValid) return; Response.Redirect ( String.Format( "Default.aspx?q={0}&cx={1}&cof={2}", HttpUtility.UrlEncode (SanitizeUserInput (q.Text.Trim ())), HttpUtility.UrlEncode (cx.Value), HttpUtility.UrlEncode (cof.Value) ), false ); Context.ApplicationInstance.CompleteRequest (); }keshav singhRank #3,113 · 460 reputationPosted Nov 15, 2009, 9:15 PM EST
http://www.codeproject.com/KB/aspnet/CustomSearchEngine.aspx
if this helps you,please check the answer
Chester Bennington47 reputationPosted Nov 15, 2009, 9:15 PM EST
keshav singhRank #3,113 · 460 reputationPosted Nov 15, 2009, 9:27 PM EST
you can save the data from textbox into database
Chester Bennington47 reputationPosted Nov 15, 2009, 9:30 PM EST
the textbox data.
How many times the user clicked that button
thnaks
chester
Urgent
keshav singhRank #3,113 · 460 reputationPosted Nov 15, 2009, 10:55 PM EST
on the button click event ,you have to retrieve the value from database and assign it to a variable and at button click it increments to one and then save the incremented value in database
Chester Bennington47 reputationPosted Nov 15, 2009, 11:02 PM EST
can you send me the code pls.
thanks
chester
Sreekanth199 reputationPosted Nov 15, 2009, 11:36 PM EST
so by clicking ur button
using this session value identify the user and update the tbale containing this users's id and counthit
EG:users table
id name
1 A
2 b
and next is users_hit
startsusers_hit from 0 and each login update this table like
update users_hit set hit=hit+1 where id=(Session[id"] or select corresponding users....from the session )
id hit
1 0
2 0
tis is ur ????