Who can help me?

Last post 09-21-2004 2:00 AM by limingyong. 7 replies.

Sort Posts:

  • Who can help me?

    07-19-2004, 8:35 PM
    • Member
      30 point Member
    • limingyong
    • Member since 03-10-2004, 1:59 AM
    • Posts 6
    Now I want to put the Formula one on Web,but it badly work!
    I also want to make it to *.dll in C#,then inport into Web Page,
    but do not what to do.Can you help me?Thanks!
  • Re: Who can help me?

    07-23-2004, 5:59 PM
    • Participant
      1,381 point Participant
    • bash_MS
    • Member since 08-06-2002, 3:40 PM
    • Posts 276
    • AspNetTeam

    Are you using visual web developer? If all you are trying to do is to reference a dll from a .aspx page, all you need to do is to add it to the bin directory of the web.

    Hope this helps. If it doesn't, please clarify what you are trying to do and I can try to help.

    -- Bash


    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Who can help me?

    08-11-2004, 3:25 AM
    • Member
      30 point Member
    • limingyong
    • Member since 03-10-2004, 1:59 AM
    • Posts 6
    Thanks!Yes,I create a usercontrol in vs2003,then make it to dll(bin's folder:AxInterop.TTF160.dll,Interop.StdType.dll,Interop.TTF160.dll,Leasear.dll ).Also I create a Web Application,copy that dlls to bin's folder.the details below:

    UserControl1:

    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Drawing;
    using System.Data;
    using System.Windows.Forms;

    namespace test1
    {
    public class UserControl1 : System.Windows.Forms.UserControl
    {
    private AxTTF160.AxF1Book axF1Book1;
    private System.ComponentModel.Container components = null;
    public UserControl1()
    {
    InitializeComponent();
    }
    protected override void Dispose( bool disposing )
    {
    if( disposing )
    {
    if( components != null )
    components.Dispose();
    }
    base.Dispose( disposing );
    }
    public int MaxCol
    {
    get
    {
    return axF1Book1.MaxCol;
    }
    set
    {
    axF1Book1.MaxCol=value;
    }
    }
    public int MaxRow
    {
    get
    {
    return axF1Book1.MaxRow;
    }
    set
    {
    axF1Book1.MaxRow=value;
    }
    }
    public void SetColText(int iCol,string ColText)
    {
    axF1Book1.set_ColText(iCol,ColText);
    }
    public string GetColText(int iCol)
    {
    return axF1Book1.get_ColText(iCol);
    }
    private void InitializeComponent()
    {
    System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(UserControl1));
    this.axF1Book1 = new AxTTF160.AxF1Book();
    ((System.ComponentModel.ISupportInitialize)(this.axF1Book1)).BeginInit();
    this.SuspendLayout();
    //
    // axF1Book1
    //
    this.axF1Book1.Location = new System.Drawing.Point(8, 8);
    this.axF1Book1.Name = "axF1Book1";
    this.axF1Book1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axF1Book1.OcxState")));
    this.axF1Book1.Size = new System.Drawing.Size(256, 200);
    this.axF1Book1.TabIndex = 0;
    //
    // UserControl1
    //
    this.Controls.Add(this.axF1Book1);
    this.Name = "UserControl1";
    this.Size = new System.Drawing.Size(272, 224);
    ((System.ComponentModel.ISupportInitialize)(this.axF1Book1)).EndInit();
    this.ResumeLayout(false);

    }
    #endregion
    }
    }

    TestFormulaOne Web APplication:

    <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="TestFormulaOne.WebForm1" %>
    <%@ Register TagPrefix="myTest" NameSpace="test1" Assembly="leasear"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

    <html>
    <head>
    <title>WebForm1</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">
    <myTest:leasear runat="server"></myTest:leasear>
    </form>
    </body>
    </html>

    backcode :

    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;

    namespace TestFormulaOne
    {
    public class WebForm1 : System.Web.UI.Page
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    }

    override protected void OnInit(EventArgs e)
    {
    InitializeComponent();
    base.OnInit(e);
    }

    private void InitializeComponent()
    {
    this.Load += new System.EventHandler(this.Page_Load);
    }
    #endregion
    }
    }
  • Re: Who can help me?

    08-11-2004, 1:43 PM
    • Participant
      1,381 point Participant
    • bash_MS
    • Member since 08-06-2002, 3:40 PM
    • Posts 276
    • AspNetTeam

    What is the error you are getting? I'm not sure what exactly you need the help with. Please clarify.

    -- Bash


    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Who can help me?

    08-11-2004, 1:44 PM
    • Participant
      1,381 point Participant
    • bash_MS
    • Member since 08-06-2002, 3:40 PM
    • Posts 276
    • AspNetTeam

    Can you confirm that what you are trying to do is to insert a windows forms user control into a web form? This is what your code indicates.

    Thanks,

    -- Bash


    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Who can help me?

    08-11-2004, 9:25 PM
    • Member
      30 point Member
    • limingyong
    • Member since 03-10-2004, 1:59 AM
    • Posts 6
    The error is:can not load the test1.leasear from the Component (Leasear, Version=1.0.1684.26398, Culture=neutral, PublicKeyToken=null ).<myTest:leasear runat="server"></myTest:leasear> is error.Before I put Formula One ActiveX Control on Windows Forms work well,Now I want to put it on Web Page.Also I try drawdrop it on Page directly in vs2003,it can display on my page,but cannot programm!Is the ActiveX Control cannot work on Web Page?Thank you!!
  • Re: Who can help me?

    08-11-2004, 9:51 PM
    • Member
      30 point Member
    • limingyong
    • Member since 03-10-2004, 1:59 AM
    • Posts 6
    Yes,I want to create the UserControl insert into Web Page. I study following Example:

    using System;
    using System.Web;
    using System.Web.UI;

    NameSpace MyFirstCustomerControl{
    public class HelloWord:WebControl
    {
    protected override void Render(HtmlTextWriter output)
    {
    output.WriteLine("Hello World");
    output.WriteLine("The time is now:"+DataTime.Now.ToString());
    }
    }
    }

    Save as HelloWorld.cs file. Then compile it:
      csc /t:Library /out:HelloWorld.dll  /r:System.DLL  /r:System.Web.DLL  HelloWorld.cs


    Now create a Web Page:

    <%@ Page Language="C#" %>
    <%@ Register TagPrefix="ACME" NameSpace="MyFirstCustomControl" Assembly="HelloWorld" %>
    <html><body>
    <ACME:HelloWorld id="helloworld1" runat="server"/>
    </body></html>

    It work well! The difference is I make an ActiveX control into DLL Compnent. Do you understand? Thanks!


  • Re: Who can help me?

    08-20-2004, 7:26 PM
    • Participant
      1,381 point Participant
    • bash_MS
    • Member since 08-06-2002, 3:40 PM
    • Posts 276
    • AspNetTeam

    You can add activex controls to your web app using the object tag. You can also add windows forms controls using the object tag. However this is not recommended since the control needs to exist on the machine from where you are browsing to the page. The user will also need to have the right permissions set to be able to view the control in the browser.

    Can I ask why you want to add a windows forms control on a web form page? Ideally what you would want to do is to add a web forms control so that it generates HTML that will work in all browsers without adding any requirement that the control needs to be on the client.

    -- Bash


    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Who can help me?

    09-21-2004, 1:28 AM
    • Member
      30 point Member
    • limingyong
    • Member since 03-10-2004, 1:59 AM
    • Posts 6
    Thanks!I really want to add a windows forms controls on a web form page,because Formula one control is very good at displaying data and editing data.like DataGrid web control can not easyly use! This might help:http://demo.actuate.com/espactivex/
    -------limingyong
Page 1 of 1 (9 items)