Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/07/2004, 18:58
Stream
 
Fecha de Ingreso: mayo-2004
Ubicación: Guadalajara, Jalisco, México
Mensajes: 724
Antigüedad: 20 años
Puntos: 6
En .NET ya no es necesario que especifiques todo entre <% ... %> eso lo puedes hacer con el code behind...

Es decir.. tratas de usar ASP.NET como si fueran las ASP.. ?


Hay muche gente que programa en webmatrix... pero... con VS.NET y el code be hind hay mucha mucha diferencia...

Con respecto a tu problema, no puedes usar componentes COM asi de simpe,.. tendrás que convertirlos a Ensamblados de .NET....


Te pondré una parte del libro de certificacion (ebook)
Cita:
Instantiate and Invoke a COM or COM+ Component
COM components are used in distributed enterprise applications to encapsulate
the business logic. As mentioned earlier, the user interface that implements these
components can be a Web application using ASP, a Win32 client application
developed in Visual Basic, Visual C++ and the like, or VBA code in a Microsoft
Office application. Most COM components will work with ASP.NET, and can be
instantiated and invoked in the same manner as they are handled with classic ASP,
using late binding.
As an example, the following code will instantiate a COM component that has a
ProgID of MyApp.Getdata in ASP.NET:
Dim objData as Object
objData = Server.CreateObject("MyApp.GetData")
The only difference between this VB.NET code in ASP.NET and classic ASP is
the language syntax. VB.NET does not use the Set statement that was required in
VBScript. Because VBScript is not compiled, it always uses late binding. ASP.NET
can use early binding, which is much more efficient. Early binding requires a
reference to the object’s type library and an explicit declaration of the object. This
enables the resolution of the object’s definition at compile time rather than at run
time (late binding), resulting in increased performance.
To use early binding, the COM components in the DLL files must be converted to
.NET Framework assemblies. This is accomplished using the Type Library Importer
(Tlbimp.exe) included with the .NET Framework SDK. This utility builds managed code wrappers around the COM components, allowing them to be early bound to
managed code in ASP.NET. The assembly file built by Tlbimp.exe must be placed in
the Web application’s \bin directory. To simplify the use of the component, you then
include a directive in the code to import the namespace:
<%@Import Namespace="ConvertedComDll"%>
If the COM component is single threaded (STA) you must include the
aspcompat=true in the @Page directive, which forces the page to execute in singlethreaded
mode. All COM components developed in Visual Basic are STA and will throw an exception if the ASP compatibility attribute is not set. STA components
can be used only in ASP.NET pages in the .NET Framework; they cannot be used
from compiled .NET assemblies.

Espero que te sirva.. por cierto.. tu problema es una pregunta de examen

Por cierto el Set ya no existe en ASP.NET
Código:
<%Dim obj
Set obj = Server.CreateObject("Inegi.Sitio.Lib.WebControls.Menu")%>

<%=obj.GeneraMenu(0)%>

Saludos !!