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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:35:36+00:00 2026-05-28T23:35:36+00:00

I need some help or information with showing the image int the <img> tag

  • 0

I need some help or information with showing the image int the <img> tag when the src attribute is the binary array (ASP.NET MVC 3):

https://stackoverflow.com/a/2644598/106616

this I the solution I use. (the purpose is, i don’t want to show users the physical image path)

Ok, then I want to use the FancyBox plugin to show that image:

<link href="@Url.Content("~/Content/jquery.fancybox-1.3.4.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.fancybox-1.3.4.js")" type="text/javascript"></script>

 <a id="book-cover-hl" href="@path">
    <img alt='' class='book-cover-details' src="@path" />
  </a>

  $(function () {
         $("a#book-cover-hl").fancybox({
             'overlayShow': false,
             'transitionIn': 'elastic',
             'transitionOut': 'elastic'
         });
   });

But, I’ve noticed if I put the @path variable in the <a [...]
href="@path">
the plugin doesn’t work properly – if I click on the
image, only the loading animation shows, but not my image. Does anyone
know how to fix it? Or maybe there is another idea ? Let me hear it
from You about that.

  • 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-28T23:35:36+00:00Added an answer on May 28, 2026 at 11:35 pm

    According to that answer, it works:

    If you want to use fancybox with data uri images like.

    <img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//
    gA8Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NzApLCBxdWFsaXR5ID0gMTAwCv/
    bAEMAAQEBAQEBAQEBAQEB......
    

    you need to change somethings in jquery fancybox script.

    1) Base on Version: 1.3.4 (11/11/2010) 2) Change line 23 for this one.

    ajaxLoader = null, imgPreloader = new Image(), imgRegExpdatauri=/
    (data:image)/i ,imgRegExp = /.(jpg|gif|png|bmp|jpeg)(.)?$/i,
    swfRegExp = /[^.].(swf)\s
    $/i,

    3) change lines 113-117 for this ones

    if (href.match(imgRegExpdatauri)) { type = ‘image2’;

    } else if (href.match(imgRegExp)) { type = ‘image’;

    4) Insert this lines after break; on line 197

    case ‘image2’: busy = false;

    $.fancybox.showActivity();

    imgPreloader = new Image();

    imgPreloader.onerror = function() {
    _error(); };

    imgPreloader.onload = function() { busy = true;

    imgPreloader.onerror = imgPreloader.onload = null;

    _process_image(); };

    imgPreloader.src = href; break;

    Now it should work.

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

Sidebar

Related Questions

I'm doing an ASP.Net MVC website, but I need some help figuring out how
I need some help extracting the following bits of information using regular expressions. Here
need some help with retrieving information+Profile pic from twitter using php , i wanted
i need some help with a php array, I need to remove the array
I need some help with echoing an SQL field but it keeps showing Resource
I need some help tracking down a bit of nitty gritty information on the
I need some help in C syntax, more about C casting syntax. All information
I need some help finding information (or an example) of how to use texture
I am very new to sql.I need some help in generating summery information MemberTable
I need some help with simple SQL code: DECLARE @procExists int SET @procExists =

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.