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

  • Home
  • SEARCH
  • 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 624371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:11:35+00:00 2026-05-13T19:11:35+00:00

I have this code in some of my ASCX files: <%=Html.ActionLink(Resources.Localize.Routes_WidgetsEdit, Edit, Widget, new

  • 0

I have this code in some of my ASCX files:

<%=Html.ActionLink(Resources.Localize.Routes_WidgetsEdit, "Edit", "Widget", 
new { contentType = Model.ContentType, widgetSlug = Model.Slug, modal=true},
new
{
  rel = "shadowbox;height=600;width=700",
  title = Resources.Localize.Routes_WidgetsEdit,
  @class = "editWidget"
})%>

Take note of that rel=”shadowbox…” there. This is to wire up ShadowBox Lightbox clone for this ActionLink.

This works fine when user requests a page containing this User Control thru normal browser request. But I also render/build those View User controls trough AJAX requests. For instance, I would make request to /Widget/RenderToString/… using jQuery .ajax() method and it would return HTML code for that control. This works fine and it renders the code fine. I would then insert (append) the result to a DIV in a page from where the AJAX request was made. This also works fine and the returned HTML gets appended. The only problem is – ShadowBox is not wired up. Even though the code for it gets rendered.

It seems it requires page reload (F5) every time to wire ShadowBox up. Since I am doing AJAX GET and instant append to get rid of having to make a server roundtrip, I would also want ShadowBox to wire up without doing refresh.

Can someone help me with that? Thank you

UPDATE:

Yes, I have this in my Site.Master head:

<script src="<%=Url.Content("~/Scripts/shadowbox-build-3.0rc1/shadowbox.js") %>" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function() {
        // insert functions calls here that provide some default behaviour
        externalLinks();
    });

    Shadowbox.init({
        language: "en",
        players: ["img", "html", "iframe"],
        onClose: function() { location.reload(true) }
    });
</script>

How do I init the Shadowbox again after AJAX call?

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

    Just found the solution here

    // call this after adding the new HTML to the page
    // set up all anchor elements with a "editWidget" class to work with Shadowbox
    Shadowbox.setup("a.editWidget", {});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have some code like this: <html> <head><title>Title</title></head> <body> <?php if (!$someCondition){
I have this code: chars = #some list try: indx = chars.index(chars) except ValueError:
I have this kind of code in some applications (from microsoft) [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( Microsoft.Naming,
I have some code like this in a winforms app I was writing to
I have some code like this: If key.Equals(search, StringComparison.OrdinalIgnoreCase) Then DoSomething() End If I
I have some code doing this : var changes = document.getElementsByName(from); for (var c=0;
I have some code like this: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Save([Bind(Prefix=)]Person person) { String s
I have added some code which compiles cleanly and have just received this Windows
Let's say I have some code like this if(isset($_GET['foo'])) //do something if(isset($_GET['bar'])) //do something
Has anyone done this / have some example code?

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.