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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:49:20+00:00 2026-05-14T07:49:20+00:00

In all my years of .NET programming I have not run across a bug

  • 0

In all my years of .NET programming I have not run across a bug as weird as this one. I discovered the problem because some elements on the page were getting double-bound by jQuery. After some (ridiculous) debugging, I finally discovered that once the view is completely done rendering itself and all its children partial views, it goes back to an arbitrary yet consistent location and re-renders itself.

I have been pulling my hair out about this for two days now and I simply cannot get it to render itself only once!

For lack of any better debugging idea, I’ve painstakingly added logging tracers throughout the HTML just so I can pin down what may be causing this. For instance, this code ($log just logs to the console):

...
<script type="text/javascript">var x = 0; $log('1');</script>
<div id="new-ad-form">
<script type="text/javascript">x++;$log('1.5', x);</script>
...

will yield

... <--- this happens before this snippet
1  
1.5 1 
...
10 <--- bottom of my form, after snippet
1.5 2 <--- beginning of part that runs again!
...
9 <--- this happens after this snippet

I’ve searched my codebase high and low, but there is NOTHING that says that it should re-render part of a page. I’m wondering if the jQueryUI has anything to do with it, as #new-ad-form is the container for a jQueryUI dialog box.

If this is potentially the case, here’s my init code for that:

$('#new-ad-form').dialog({

autoOpen: false,
modal: true,
width: 470,
title: ‘Create A New Ad’,
position: [‘center’, 35],
close: AdEditor.reset
});

  • 1 1 Answer
  • 2 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-14T07:49:21+00:00Added an answer on May 14, 2026 at 7:49 am

    As I suspected in my original question, the issue is with jQueryUI’s dialog() method. After the page renders, the element assigned as the dialog box gets re-rendered, meaning any Javascript contained or loaded in that element is re-run. In my case I had two partial views that had their own JS files.

    I wrote the ugliest hack to get around it, but I got it working by creating a global variable and checking it before calling anything in the $(function()). I died a bit writing that hack, but heck, now we can ship!

    Thanks for anyone who tried to help!

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

Sidebar

Related Questions

I've been programming with Qt libraries for 3 years. All programs have been designed
I have been doing Windows programming in .Net since last two years. Now I
Up to now in my programming career (two years) I have not had much
Eventhough I have been involved in .net for a few years I have not
All these years i have been successfully using EnumServicesStatus in combination with OpenScManager (with
I've been programming in JAVA and C all my years at Uni, but now
I have a time interval that spans years and I want all the time
I have developed web applications for a couple of years with ASP.NET Webforms and
I have years of experience with Microsoft .NET development (primarily C#) and have been
All, This would seem like a fairly basic asp.net question - but in all

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.