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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:28:41+00:00 2026-06-05T04:28:41+00:00

I have a custom control and it’s been registered in main page in a

  • 0

I have a custom control and it’s been registered in main page in a hidden div. On page load I show a modal window (fancybox 2) with content the one that has the hidden div.

My problem is that this control has a button and it doesn’t fire from the fancybox.

I tried this Fancybox – ASP.NET button not working but nothing changed.

Does anyone know how to fix this? The preferable would be a fix without amending the fancybox.js.

The code where the control is placed in

<a href="#inline" style="display: none" id="trigerButton"></a>
<div id="inline" style="display: none; width: 500px;">
    <asp:PlaceHolder runat="server" ID="PhCtrl"></asp:PlaceHolder>
</div>

from codeBehind

var ctrlName = LoadControl("~/Path/control.ascx");
ctrlName.ID="ctrlID";
PhCtrl.Controls.Add(ctrlName);
var sb = new StringBuilder();
sb.Append("$(document).ready(function() {");
sb.Append("$('#trigerButton').fancybox({modal:true}).trigger('click');");
sb.Append("$('#clickNo').click(function(){$.fancybox.close(true)});");
sb.Append("});");
ClientScript.RegisterStartupScript(typeof(T), "_script", sb.ToString(), true);

The custom control

It has a button and this button doesn’t fire

<asp:Button runat="server" ID="Button1" Text="Upgrade" OnClick="Button1_click" />
  protected void Button1_click(object s,EventArgs e)
    {
        //Do something 
    }

I would appreciate any suggestions

Thanks

SOLUTION

I didn’t manage to find a solution without editing the fancybox.js, though I replaced every

appendTo('body')

with

appendTo('form:first')
  • 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-05T04:28:42+00:00Added an answer on June 5, 2026 at 4:28 am

    The main reason for this issues is because the funcybox is making modifications on the DOM struct in order to make the dialog and place it somewhere in the page.

    In your case the issue can be that the end rendered control is place the final input button outside the asp.net form, and that’s why is not even fired.

    Update

    I found a similar question, on similar box. The solution may also work here

    Its add the dialog creation inside the form using the

    jQuery('#dialogof').appendTo('form');
    

    ASP.NET Form Fields Not POSTing from colorbox

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

Sidebar

Related Questions

I have a Custom Control registered in the page using this code: <%@ Register
I have a custom control which displays results of some operations. It is hidden
I have a custom control (C#, visual studio). I want to show a tooltip
I have a custom control that has an event. I have a window using
I have a custom control on a form. Basically my Visual Studio has been
I have custom control where i want to show some items. In generic.xaml defined
I have custom server control contains templatefield when an out button clicked the field
I have a custom control with a public collection marked as DesignerSerializationVisibility.Content . When
I have a Custom Control that has multiple textbox fields and a checkbox contained
I have a custom control that inherits from UserControl , and I can't get

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.