P
parkchan
Hi everyone,
I have a problem calling an event in a DLL from a C# code. The dll is
written in VB.NET and I don't have the source code for it so I can't
modify it. The DLL came with an aspx file and they work fine together,
but the problem arose when I tried to convert aspx ("Page") into ascx
("UserControl"). After changing the file name to ascx and declaration
at the top of the page common web controls that have calles to events
in the DLL cannot sees them even though I've imported the dll at the
top of the control in declaration.
----------------------- This works --------------------------
<%@ Page Language="C#" Codebehind="TestCode.aspx.vb"
Inherits="TestDll.TestCode" %>
.....
<!-- code below can see the event -->
<asp:button id="cmdTest" onClick="event_in_dll"></asp:button>
-------------------------------------------------------------------
----------------------- This DOESN'T work --------------------------
<%@ Control Language="C#" %>
<%@ Imports Namespace="TestDll" %>
.....
<!-- code below can NOT see the event -->
<asp:button id="cmdTest" onClick="event_in_dll"></asp:button>
-------------------------------------------------------------------
I've tried everything that came across but had no luck. I have to
convert it to a User Control.
Could anyone help me with this please?
Thanks in advance,
Chan
I have a problem calling an event in a DLL from a C# code. The dll is
written in VB.NET and I don't have the source code for it so I can't
modify it. The DLL came with an aspx file and they work fine together,
but the problem arose when I tried to convert aspx ("Page") into ascx
("UserControl"). After changing the file name to ascx and declaration
at the top of the page common web controls that have calles to events
in the DLL cannot sees them even though I've imported the dll at the
top of the control in declaration.
----------------------- This works --------------------------
<%@ Page Language="C#" Codebehind="TestCode.aspx.vb"
Inherits="TestDll.TestCode" %>
.....
<!-- code below can see the event -->
<asp:button id="cmdTest" onClick="event_in_dll"></asp:button>
-------------------------------------------------------------------
----------------------- This DOESN'T work --------------------------
<%@ Control Language="C#" %>
<%@ Imports Namespace="TestDll" %>
.....
<!-- code below can NOT see the event -->
<asp:button id="cmdTest" onClick="event_in_dll"></asp:button>
-------------------------------------------------------------------
I've tried everything that came across but had no luck. I have to
convert it to a User Control.
Could anyone help me with this please?
Thanks in advance,
Chan