tags:

views:

66

answers:

2

i have a database table of website links. i have another table of tags, and tagmap (bridge table)

I am displaying a list of links in a view and on the right hand side i have a list of tags (similar to SOF). A link can have many tags.

when i click on a tag, i would like to refresh the link list with just links filtered by that tag.

I have a controller action to do this but i want to avoid refreshing the page.

how do i click a controller action and get a list of new links back without refreshing the whole page?

A: 

One way you could do this, is by changing your links on tags to something like that:

onclick="MyFunction(); return false;"
this will make sure you won't actually "click" a link and refresh the page. Then, in your function, you could go through your links, and kick out those, that you don't like.
Alternatively, you could send ajax query to your controller, with your new filter settings, and controller could give you back the whole div (with those links on the left), that you should then set, in place of old one, in your callback function.

Ravadre
+2  A: 

Use an ajax query to return a Partial View and refresh your div.

David Liddle
do you have any links to any example here?
ooo