Thumbs Up/ Down postback event

D

DanWeaver

I am trying to implement a "thumbs up- down" scoring system- I have an
asp: repeater control to spit to my page a series of unique data eg
John Yay- 2 Nay 10
Lucy Yay- 5 Nay 12
Susie Yay- 25 Nay 3
Each of which has a unique id in my sql database. I have a thumbs up
and thumbs down icon and a current number as shown above. As in
www.urbandictionary.com I would like the number to update immediately
the user clicks the icon- no problem- javascript- the question is...
how do I collect the scoring info to update the sql db- the client
need not update at all for the session- worse posting back everytime
the user clicks yay or nay-. I have considered creating a hidden asp
text box which gathers unique id of eg John, Lucy and -1, or +1 - at
the server this can be used to update the db- BUT WHEN does it get
posted to the server and how is this achieved- what event should fire
this post and can it be done without disrupting the user experience. A
simple example would be lovely if anyone has one.

Dan
 
G

Guest

Hi,

with the ASP.NET AJAX Extensions this is a piece of cake. Put everything
into an UpdatePanel, create 2 button click events thumbs up and thumbs down
and execute the SQL stuff there.

hth

Andreas
 
D

DanWeaver

Thanks Andreas,

I thought about using an update panel- but using this the users page
is updated every time the user thumbs up/ down- perhaps 25 postbacks -
x Y users- a lot of unneccessary postbacks considering the users page
doesnt need to be updated at all- does anyone know how www.urbandictionary.com
does it? Maybe I am misunderstanding update panel and I could just
rally all thumbs up/down information along with the id of the repeater
element they referred to and do one update per session- but in this
case what event would fire the postback (I dont really want the user
to be forced to "submit" their votes).
 
G

Guest

Hi Dan,

sorry, maybe I missunderstood you. Could you maybe show us some code?

If you just put the Thumbs Up and Thumbs Down Icons including the count in
the UpdatePanel, just that little section is being updated on a Postback, at
least for the User, the Server executes the whole process.

Best Regards,
Andreas
 
L

Lloyd Sheen

DanWeaver said:
Thanks Andreas,

I thought about using an update panel- but using this the users page
is updated every time the user thumbs up/ down- perhaps 25 postbacks -
x Y users- a lot of unneccessary postbacks considering the users page
doesnt need to be updated at all- does anyone know how
www.urbandictionary.com
does it? Maybe I am misunderstanding update panel and I could just
rally all thumbs up/down information along with the id of the repeater
element they referred to and do one update per session- but in this
case what event would fire the postback (I dont really want the user
to be forced to "submit" their votes).

Well after waiting 20 mins to see if the site you mentioned would actually
show me something other than the header, I gave up. I will leave IE on and
see if after a couple of days it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top