PDF Version
ASP.Net with Iocomp ActiveX controls
This tutorial assumes that you are familiar with ASP.Net
and ActiveX controls.
Steps to host Iocomp ActiveX
controls in an ASP.NET page using Visual Studio 2003
The following example shows how to use the iSliderX
control on a Web Form in Microsoft Visual Basic .NET. This example sets the position
of the Slider to 50 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.
1. Create a new ASP.NET
Web Application project in
Visual Basic .NET 2003. 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, select 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:
Copy code
|
|
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>ASP.NET with Iocomp ActiveX Control</title>
<script language = "javascript">
window.onload = SetPosition;
function SetPosition(iSliderX1)
{
iSliderX1 = Form1.iSliderX1;
iSliderX1.Position = 50;
}
</script>
</head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<OBJECT ID="iSliderX1"
CLASSID="clsid:C5412E06-2E2F-11D3-85BF-00105AC8B715" VIEWASTEXT>
</OBJECT>
</form>
</body>
</html> |
4. Run your application by hitting Ctrl+F5.
Alternatively, you can insert the control through the integrated development environment
(IDE) by following these steps:
1. On the toolbox, either select an existing tab
or create a new tab for the Iocomp ISliderX control.
2. Right-click in any area on the tab, and then click Customize
toolbox.
3. On the COM Components tab, scroll down, and check the
checkbox next to the iSliderX control..
4. Click the OK button, and now the iSliderX control will
appear on the toolbox tab you selected. Drag this control onto the Web Form.
Steps to host Iocomp ActiveX Controls in ASP.Net page using Visual
Studio 2005
1. Create a new ASP.Net page in Visual Studio.Net 2005 development
environment. To do this, follow these steps:
a. On the File menu, click New and
then click Website.
b. In the New Website dialog box, under template select an
ASP.Net
Website.
c. Under Language, select Visual C#
and then save it
to the
desired location by clicking OK.
2. You now have an empty Web Form called Default.aspx. To see the HTML version of
the page, click the Source button in the lower-left of the Design window.
3. Replace the existing code with the following code:
Copy code
|
|
<%@ page autoeventwireup="true" codefile="Default.aspx.cs" inherits="_Default" language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ASP.NET with Iocomp ActiveX Control</title>
<script type="text/javascript">
var objID = 'iSliderX1';
window.onload = SetPosition;
function SetPosition(iSliderX1)
{
iSliderX1 = document.getElementById(objID);
iSliderX1.Position = 50;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<object id="iSliderX1"
classid="clsid:C5412E06-2E2F-11D3-85BF-00105AC8B715">
</object>
</form>
</body>
</html>
|
4. Run your application by hitting Ctrl+F5.
Alternatively, you can insert the control through the integrated development environment
(IDE) by following these steps:
1. On the toolbox, either select an existing tab
or create a new tab for the Iocomp ISliderX control.
2. Right-click in any area on the tab, and then click Choose Items.
3. On the COM Components tab, scroll down, and check the
checkbox next to the iSliderX control..
4. Click the OK button, and now the iSliderX control will
appear on the toolbox tab you selected. Drag this control onto the Web Form.
Steps to host Iocomp ActiveX Controls in ASP.Net
page using Visual Studio 2008
1. Create a new ASP.Net page in
Visual Studio.Net 2008 development
environment. To do this, follow these steps:
a. On the File menu, click
New and then click Website.
b. In the New Website dialog box, under template select an
ASP.Net Website.
c. Under Language, select Visual C# and then save it to the
desired location by clicking OK.
2. You now have an empty Web Form called
Default.aspx. To see the HTML version of the page, click the Source button in the
lower-left of the Design window.
3. Replace the existing code with the following code:
Copy code
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
%>
<!!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ASP.NET with Iocomp ActiveX Control</title>
<script type = "text/javascript">
var objID = 'iSliderX1';
window.onload = SetPosition;
function SetPosition(iSliderX1)
{
iSliderX1 = document.getElementById(objID);
iSliderX1.Position = 50;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<object id="iSliderX1"
CLASSID="clsid:C5412E06-2E2F-11D3-85BF-00105AC8B715">
</object>
</form>
</body>
</html>
|
4. Run your application by hitting Ctrl+F5.
Alternatively, you can insert the control through the integrated development environment
(IDE) by following these steps:
1. On the toolbox, either select an existing tab
or create a new tab for the Iocomp ISliderX control.
2. Right-click in any area on the tab, and then click Choose Items.
3. On the COM Components tab, scroll down, and check the
checkbox next to the iSliderX control..
4. Click the OK button, and now the iSliderX control will
appear on the toolbox tab you selected. Drag this control onto the Web Form.
For more details please refer to our
Active On-Line Examples.