Asp.net mvc: Ajax actionlink or jQuery?

I am trying to change images on a click, similar to how this is done using arrows and checkmarks.

Im thinking either:

1- Let each image be Ajax.ActionLink and return a different image when clicked.

2- Make the images the background of the hyperlink and use Ajax.ActionLink to replace the css class to get a new image.

3 Use jQuery instead.

What is the best way to go and you can give examples?

+3
source share
2 answers

jquery , actionlink asp.net-mvc, ( ), .

jquery - ,

 $(document).ready(function() {
       //image is the name of the class of your images
     $(".image").click(function() {

     $(".image").hide(); //just an example..
        });
 }) ;      

, . jquery tutorials, , , , .. css , - . mund, asp.net, - asp jquery , . ASP- , :

  ("#image1").click(function() {

- asp, asp: imagebutton, :

   ("#ct100_******image1").click(function() {

... , , , asp.net , runat = Server runat = server - asp

+5

jQuery. ajax .

0

Source: https://habr.com/ru/post/1702279/


All Articles