Monday, February 8, 2010

How to Use Activex Control in .net?

here is the step by step guide o how to use it..!!





http://www.shoxee.com/2009/10/how-to-use鈥?/a>How to Use Activex Control in .net?
Complete code for hosting a sample ActiveX control in an ASP.NET page


The following example shows how to use the MSChart control on a Web Form in Microsoft Visual Basic .NET. This example changes the width of the chart when the page is loaded. You can view the HTML version of the ASPX page and then copy and paste the following code into the page. This action replaces the original code. To do this, follow these steps:





1.Create a new ASP.NET Web Application project in Visual Basic .NET. To do this, follow these steps:





a.On the File menu, click New, and then click Project.


b.Under Project Types, click Visual Basic Projects.


c.Under Templates, click ASP.NET Web Application.





2.You now have an empty Web Form. To see the HTML version of the page, click the HTML button in the lower left of the Design window.





3.Replace the existing code with the following code:





%26lt;%@ Page SmartNavigation=';true'; Language=';vb'; AutoEventWireup=';false';


Codebehind=';WebForm1.aspx.vb'; Inherits=';VBWebApp.WebForm1';%%26gt;


%26lt;!DOCTYPE HTML PUBLIC ';-//W3C//DTD HTML 4.0 Transitional//EN';%26gt;


%26lt;HTML%26gt;


%26lt;HEAD%26gt;


%26lt;title%26gt;WebForm1%26lt;/title%26gt;


%26lt;script language=';javascript';%26gt;


function changeWidth(x)


{


x.width = 300


}


%26lt;/script%26gt;


%26lt;/HEAD%26gt;


%26lt;body MS_POSITIONING=';GridLayout';%26gt;


%26lt;form id=';Form1'; method=';post'; runat=';server';%26gt;


%26lt;OBJECT id=';chart1'; style=';


Z-INDEX: 102; LEFT: 125px; WIDTH: 484px;


POSITION: absolute; TOP: 85px; HEIGHT: 200px';


onReadyStateChange = ';changeWidth(this)';


classid=';clsid:3A2B370C-BA0A-11D1-B137-0鈥?VIEWASTEXT%26gt;


%26lt;/OBJECT%26gt;


%26lt;/form%26gt;


%26lt;/body%26gt;


%26lt;/HTML%26gt;

No comments:

Post a Comment