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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:22:49+00:00 2026-05-11T16:22:49+00:00

We have some html that looks like this: <form id=MyUserControl runat=server method=post> <script language=javascript

  • 0

We have some html that looks like this:

<form id="MyUserControl" runat="server" method="post">
   <script language="javascript" src="javascript.js"></script>

The javascript file contains something like this:

document.write('<object id="MyUserControl" ');
document.write('classid="MyUserControl.dll#MyNamespace.MyUserControl"');
document.write('height="611" width="951" >');
document.write('<param name="Parm1" value="' + parm1 + '" />');
document.write('</object>');

Essentially, I’d like to be able to display some text or leave standby text in place if the object does not load properly.

The reason for all of this is that we are trying to migrate an old app from FoxPro to .Net while it’s still in use. It’s a fairly large application and we’re converting a screen at a time. We’re building .Net user controls and they are displayed in a browser object inside of FoxPro. The html and js above allow us to embed the winforms user control in a web page.

If a particular user does not have a code access group for our application server set up, the user control does not render and the screen just shows the little icon in the upper left corner that looks like something is trying to load. It never does load, but I want to signal the user to email our team to get their access straightened out.

I tried using standby and alt, but neither showed text. All of our users have IE7 and this is just a temporary solution (< 6 months).

  • 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-11T16:22:50+00:00Added an answer on May 11, 2026 at 4:22 pm

    You can put any inline elements within the object tag, and if it fails to load, they will be presented to the user.

    <object>
      This object failed to load,
      try to install <a href="http://plugin-site/">here</a>
    </object>
    

    MSDN: OBJECT Element | object Object

    Wanted to add some notes about odd IE behaviors. (IE < 8)
    When using the above code where failure content is to be displayed, you will lose access to the object in DOM. So you may want to keep it empty and do some extra code to determine the load success.

    <!DOCTYPE html>
    <html>
    <head>
      <title>so-objects</title>
      <script type="text/javascript">
    
        function add(text) {
          document.body.appendChild(document.createElement("div"))
                       .appendChild(document.createTextNode(text));
        };
    
        function each(o, f, c) {
          for (var i=0, l=o.length; i<l; i++) f.call(c, o[i], i, o);
        };
    
        onload = function() {
    
          // IE returns null and has mysteriously removed the object from DOM
          add("byId = "+ document.getElementById("no-access") );
    
          // IE returns 2 instead of 3
          add("byTags = "+ document.getElementsByTagName("object").length );
    
          // verify successful load if the object property is available
          each(document.getElementsByTagName("object"), function(node) {
            add(node.id +" = "+ !!node.object);
          });
    
        };
    
      </script>
      <style type="text/css">
        object, span { position: absolute; left:-10000px; }
      </style>
    </head>
    <body>
    
      <object id="access">
      </object>
    
      <object id="no-access">
        <span>failed</span>
      </object>
    
      <object id="supported"
         classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6">
      </object>
    
    </body>
    </html>
    

    Returned values for IE < 8

    byId = null
    byTags = 2
    access = false
    supported = true
    

    Returned values for W3C Compliant

    byId = [object HTMLObjectElement]
    byTags = 3
    access = false
    no-access = false
    supported = false
    

    Try for yourself

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

Sidebar

Ask A Question

Stats

  • Questions 109k
  • Answers 109k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer http://jqueryfordesigners.com/ They have some very good stuff. May 11, 2026 at 9:25 pm
  • Editorial Team
    Editorial Team added an answer I had the same problem until I removed the quotation… May 11, 2026 at 9:25 pm
  • Editorial Team
    Editorial Team added an answer ASP.NET MVC Stackoverflow Codeplex MarketWatch Restaurantica Kbb Ruthschris ASP.NET Monster… May 11, 2026 at 9:25 pm

Related Questions

I'm doing some maintenance coding on a webapp and I am getting a javascript
We want to perform some calculations on some values in a view...so when the
Hey. We're building a large ASP.NET website, and have hired an external firm to
I seem right now to be embroiled in a debate with another programmer on
The Back Story I have some decimal values which I am displaying as strings

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.