G
Guest
The following code is intended to display a winform (DateTimePicker Control)
in a browser. But, when the aspx page that contains the reference to the
winform in the object tag is run, all that is displayed is a blank
placeholder and not the control. Any ideas or help is appreciated!
DateTimePicker.cs WinForm control code - output type class library
===========================================
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Windows.Control.Library
{
/// <summary>
/// Summary description for DateTimePicker.
/// </summary>
public class DateTimePicker : System.Windows.Forms.Form
{
private System.Windows.Forms.DateTimePicker dateTimePicker1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public DateTimePicker()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.SuspendLayout();
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(40, 40);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.TabIndex = 0;
//
// DateTimePicker
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.dateTimePicker1);
this.Name = "DateTimePicker";
this.Text = "DateTimePicker";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new DateTimePicker());
}
}
}
ASPX PAGE CODE
======================
<%@ Page language="c#" Codebehind="UseWinControl.aspx.cs"
AutoEventWireup="false" Inherits="web.playground.UseWinControl" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>UseWinControl</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<OBJECT id=WinControl2
classid=http:Windows.Control.Library.dll#Windows.Control.Library.DateTimePicker
height=500 width=200
VIEWASTEXT></OBJECT>
</form>
</body>
</html>
in a browser. But, when the aspx page that contains the reference to the
winform in the object tag is run, all that is displayed is a blank
placeholder and not the control. Any ideas or help is appreciated!
DateTimePicker.cs WinForm control code - output type class library
===========================================
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Windows.Control.Library
{
/// <summary>
/// Summary description for DateTimePicker.
/// </summary>
public class DateTimePicker : System.Windows.Forms.Form
{
private System.Windows.Forms.DateTimePicker dateTimePicker1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public DateTimePicker()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.SuspendLayout();
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(40, 40);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.TabIndex = 0;
//
// DateTimePicker
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.dateTimePicker1);
this.Name = "DateTimePicker";
this.Text = "DateTimePicker";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new DateTimePicker());
}
}
}
ASPX PAGE CODE
======================
<%@ Page language="c#" Codebehind="UseWinControl.aspx.cs"
AutoEventWireup="false" Inherits="web.playground.UseWinControl" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>UseWinControl</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<OBJECT id=WinControl2
classid=http:Windows.Control.Library.dll#Windows.Control.Library.DateTimePicker
height=500 width=200
VIEWASTEXT></OBJECT>
</form>
</body>
</html>