BUG: The "Classid" Attribute of the Windows User Control in an <Object> Tag Is Case Sensitive (315160)



The information in this article applies to:

  • Microsoft .NET Framework 1.1
  • Microsoft .NET Framework 1.0
  • Microsoft Internet Explorer (Programming) 5.5
  • Microsoft Internet Explorer (Programming) 6.0

This article was previously published under Q315160

SYMPTOMS

With Internet Explorer 5.5 or later, Web-based applications can download and run assemblies in a Web page.

For example, the following code references myClass:
<object id="myCtl" classid="http://www.mycode.Microsoft.com/mycode.dll#myClass"> </object>
				
However, if you load a user control with the code, an empty box may be displayed instead of the user control.

CAUSE

This problem occurs because the name of user control in the classid attribute of the <object> tag is case sensitive.

RESOLUTION

To resolve this problem, use the correct case for the name of the user control in the classid attribute of the <object> tag.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Problem

  1. Create a custom Windows Forms control. Start Visual Studio .NET.
  2. On the File menu, click New, and then click Project.
  3. In the Visual Basic project type, click Windows Control Library.
  4. Add a button to the designer and add the following command in the Clicked event:
    MessageBox.Show("Clicked")
    					
  5. Add a new HTML page to the project that is named htmlpage1.htm.
  6. Add the following tag to the body of the HTML page:
    <object id="WindowsControlLibrary1" 
    classid="http://localhost/WindowsControlLibrary1.dll#WindowsControlLibrary1.usercontrol1"> </object>
    						
    NOTE: usercontrol1 is in lowercase, which is the cause of the problem.
  7. Build the project.
  8. Copy the WindowsUserControl1.dll file and the HTML page to your \Inetpub\Wwwroot folder.
  9. Direct your browser to the http://localhost/htmlpage1.htm address. The user control is not displayed.
  10. In the HTML page, change the classid attribute to reflect the appropriate name of the user control (which is UserControl1) and navigate to the Web page; the control is displayed as expected.

Modification Type:MajorLast Reviewed:6/5/2003
Keywords:kbCtrl kbbug kbpending KB315160