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 7944127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:27:57+00:00 2026-06-04T00:27:57+00:00

I trying to use the some plugin for show images in popup window. I

  • 0

I trying to use the some plugin for show images in popup window.
I tryed Thickbox, fancybox, but not works.

I think the problem in my URL.

This is my code:

<a href='@Url.Action("GetSchemaImage", "Hall", new {folderName = @Model.FolderName })' class="fancybox"><img src='@Url.Action("GetSchemaImage", "Hall", new {folderName = @Model.FolderName })'/></a>

This is controller’s action:

public ActionResult GetSchemaImage(string folderName)
        {
            if(string.IsNullOrWhiteSpace(folderName))
                return new EmptyResult();
            var folder = ConfigurationManager.AppSettings["SchemasFolder"];
            var path = Path.Combine(folder, folderName);
            var schemaImage = Directory.GetFiles(path, "*.*").FirstOrDefault(s => s.EndsWith(".png") || s.EndsWith(".jpg"));
            if (schemaImage != null) 
                return File(Path.Combine(path, schemaImage), "image/png");
            return new EmptyResult();
        }

This is generated markup:

<a class="fancybox" href="/Hall/GetSchemaImage?folderName=marineclub"><img src="/Hall/GetSchemaImage?folderName=marineclub"></a>

As I said, I think the problem in URL: /Hall/GetSchemaImage?folderName=marineclub. The plugin can’t understand this.

I think URL must be the following: /Hall/GetSchemaImage/marineclub.
How can I rewrite my code that the fancybox can work?

This is javascript code:

$(function () {            
        $(".fancybox").fancybox({ type: image });
})

Big thanks.

UPDATE:
This is all routes:

public static void RegisterRoutes(RouteCollection routes)
        {
            var entryRoute = new PageEntry("page/{name}/",
                                           new RouteValueDictionary(
                                               new
                                               {
                                                   controller = "DynamicPage",
                                                   action = "Index",
                                                   name = String.Empty
                                               }),
                                               new RouteValueDictionary(new { name = @".+" }),
                                           new MvcRouteHandler());

            routes.Add("display-page",
                       entryRoute);

            routes.MapRoute("Event Overview", "{city}/{type}/{id}",
                            new {city="astana", controller = "BaseEvent", action = "EventOverview"}, new {city = new CityConstraint()});


            routes.MapRoute(
                "Cinema", // Route name
                "{city}/cinema", // URL with parameters
                new { city = "astana", controller = "Cinema", action = "Index" }, // Parameter defaults
                new { city = new CityConstraint() }
            );

            routes.MapRoute(
                "Concert", // Route name
                "{city}/concert", // URL with parameters
                new { city = "astana", controller = "Concert", action = "Index" }, // Parameter defaults
                new { city = new CityConstraint() }
            );

            routes.MapRoute(
                "Club", // Route name
                "{city}/club", // URL with parameters
                new { city = "astana", controller = "Club", action = "Index" }, // Parameter defaults
                new { city = new CityConstraint() }
            );

            routes.MapRoute(
                "Children", // Route name
                "{city}/children", // URL with parameters
                new { city = "astana", controller = "Children", action = "Index" }, // Parameter defaults
                new { city = new CityConstraint() }
            );

            routes.MapRoute(
                "Sport", // Route name
                "{city}/other", // URL with parameters
                new { city = "astana", controller = "Other", action = "Index" }, // Parameter defaults
                new { city = new CityConstraint() }
            );

            routes.MapRoute(
                "Theater", // Route name
                "{city}/theater", // URL with parameters
                new { city = "astana", controller = "Theater", action = "Index" }, // Parameter defaults
                new { city = new CityConstraint() }
            );  


            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional });


            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");



            routes.MapRoute(
                "Activate",
                "Account/Activate/{username}/{key}",
                new
                {
                    controller = "Account",
                    action = "Activate",
                    username = UrlParameter.Optional,
                    key = UrlParameter.Optional
                });

            routes.MapRoute(
               "ResetPassword",
               "Account/Reset/{email}/{key}",
               new
               {
                   controller = "Account",
                   action = "Reset",
                   email = UrlParameter.Optional,
                   key = UrlParameter.Optional
               });
        }
  • 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-06-04T00:27:59+00:00Added an answer on June 4, 2026 at 12:27 am

    So if you want a URL like this : /Hall/GetSchemaImage/marineclub you could do one of two things:

    • Change your action method like this so it matches your default route:

      public ActionResult GetSchemaImage(string id)
      

      So now Hall/GetSchemaImage/marineclub => {controller}/{action}/{id}

    OR

    • Add a route to match your controller:

      routes.MapRoute(
                  "ImageStuff", // Route name
                  "{controller}/{action}/{folderName}", // URL with parameters
                  new { controller = "Hall", action = "GetSchemaImage",
                      folderName = UrlParameter.Optional });
                      //^^ if set optional it will null if not specified.
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use JQuery's autocomplete plug-in but for some reasons Internet Explorer is
I am trying to use Lightbox plugin but with jquery there is a conflict
I am trying to use the JQuery cookie plugin in my project but I'm
I'm trying to use jquery jcrop to crop images. this code starts the plugin
Trying to use JQuery Easing plugin in my wordpress but its giving me following
I'm trying to use marquee plugin of jQuery. but i get this error in
I'm trying to use jQuery-jsonp plugin with jQuery Deferred Objects but I'm having no
I am trying to use some ajax and the jQuery Masonry plugin to add
I'm trying to use the SVN Publisher plugin to commit some artifacts of my
I'm trying to use the FitText jquery plugin to get resize some text. The

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.