Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1076727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:28:26+00:00 2026-05-16T21:28:26+00:00

Hi guys i know this is a known problem in ASP.NET MVC, basically what

  • 0

Hi guys i know this is a known problem in ASP.NET MVC, basically what i have here is a photo gallery with categories (Red, Blue, Green).

When i choose one category, say ‘Red’, it will do an ajax call and load the page with photos of red colored products. when i click one of the photos, i expect it to be enlarged (lightbox kinda effect). I use a jQuery plugin called fancybox for that.

but as u all know jQuery using a dynamically loaded content with jquery in it , doesnt actually work in ASP.NET MVC. So i added the jQuery call to fancybox into the ajax.success.

but since it is a plugin, the function $(“.fancybox”).fancybox() does not register and says that it’s not a valid javascript function. How can i solve this problem, so that i can do the image enlarge thing after an ajax call? thank you!

   $(document).ready(function() {
        $("select#Colors").change(function() {
            var color = $("#Colors > option:selected").attr("value");
            var tempnric = $(".tempnric").attr("value");
            $("#ProductsDiv").hide();
            $('#ajaxBusy').show();
            $.ajax({
                type: "GET",
                contentType: "application/json; charset=utf-8",
                url: "/FindProducts/" + color,
                data: "{}",
                dataType: "json",

                success: function(data) {
                    $('#ProductsDiv > div').remove(); // remove any existing Products
                    if (data.length > 0) {
                        var options = '';
                        for (p in data) {
                            var product = data[p];
                            options += "<a href='/GetPhotoSet/" + product.PhotoID + "' class='fancybox load fade'><img src='/GetPhotoSet/" + product.PhotoID + "'/></a>";

                        }
                        $("#ProductsDiv").html(options);
                        $('#ajaxBusy').hide();
                        $("#ProductsDiv").show();

                    } else {
                        $("#Products").attr('disabled', true).html('');
                        $("#ProductsDiv").append('<div>(None Found)</div>');
                    }
                }
            });

        });
    });

Here is the remaining code it works ok except that when i click on the images, it opens up a new browser..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T21:28:28+00:00Added an answer on May 16, 2026 at 9:28 pm

    Before your document.ready call, put this line of code:

     var $j = jQuery.noConflict();
    

    Then replace all of the ‘$’ references with ‘$j’ and your code should now work.

    There is probably a conflict between some other javascript and the jQuery script, so your document.ready is not being seen. This is the quickest way to work around the problem. And if you’re feeling ambitious, you can find out what is going on by using a tool such as FireFox’s Error Console.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written an ASP.NET MVC application that allows the user to specify their
guys I know this question is very basic but I've met in few publications
Guys I know this question is silly but just to make sure: Having in
Ok guys, I know this is pretty a rare case but I really would
I know that this is a simple question for PHP guys but I don't
Hi guys anyone know what the helll is going on here? ERROR SNIPPET: Loading
I'm trying to get my company to move to ASP.NET MVC and away from
I have a pretty big web application that I created last year using ASP.NET
Guys, I know this is going to turn out to be a simple answer,
Hi guys I was hoping from some help here, please. I have a INSERT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.