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
I have been looking at many ASP.Net MVC client side validation ideas including xVal.
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
Ok guys and gals, here is my problem: I've built a custom control that
Hi guys I wrote this code and i have two errors. Invalid rank specifier:
I'm trying to get my company to move to ASP.NET MVC and away from
The setup: Winform/ASP.NET MVC projects. Learning NHibernate SQL-Server driven apps I work with clients
I have a pretty big web application that I created last year using ASP.NET
Hi this question or problem i have its very hard i have search and

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.