Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Responding to changes to controls in a Repeater

Thread Tools

Responding to changes to controls in a Repeater

Kevin Donn
Posts: n/a
I want to mimic the Remove checkbox behavior of the Netflix Queue page. It
looks like pretty traditional, full-page post and render stuff. I've done
things like it using frameworks other than ASP.NET, but I haven't found a
way to leverage the architecture of ASP.NET to do it.

Here's the nutshell of what Netflix does: your queue page is a listing of
each movie you've requested. Each item has a Remove checkbox on the line.
When you click the box no communication with the server happens, Ajax or
otherwise. You can click all the boxes you want but nothing happens until
you click "Update Your Queue" which causes a traditional post and re-render
of the page to happen, and your checked movies will be gone.

I don't want to do any communication until the user posts the page. What I
*do* want is to be able to spot the boxes the user has checked when the page
gets posted. The DataGrid and DataList both just don't support this type of
behavior, so Repeater seems like the only choice. But Repeater does not
support instantiating ASP.NET controls (or anything with runat="server") in
the ItemTemplate. You can, however, have checkboxes in the ItemTemplate, so
the question becomes, how do you spot changes to these checkboxes when the
page is posted and map them back to your dataset?

Kevin Donn

Reply With Quote
Posts: n/a

hello kevin

the DataList and the DataGrid can be set up to do just what you want

on these pages are working examples of specifying multiple items to
remove in a list by using checkboxes ( not exactly what you need but
something similar )

Reply With Quote
Posts: n/a
I do a similar thing using XML and it works well for me. I use a gridview for this but a datagrid works just as well. I build an XML document with a list of all the items to remove. Then in SQL Server, I delete all the selected items from the table and rebind the gridview.

This uses one server trip for the delete and one for the rebinding gridview.
Email me and I can send you the code.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a controls ID property inside a repeater controls ItemTemplate the value of the ItemIndex? Andy B ASP .Net 1 11-15-2008 07:17 PM
Responding to events in dynamically created web controls JezB ASP .Net Web Controls 2 06-21-2004 06:22 AM
responding to events raised by controls in a webcontrol colter k?ntz via .NET 247 ASP .Net Building Controls 1 06-15-2004 09:47 PM
User controls not responding... please help =?Utf-8?B?S2V2aW4gSm9uZXM=?= ASP .Net 0 04-22-2004 07:31 PM
Array object responding to changes Ben Katz Javascript 1 09-30-2003 03:35 AM