Custom Controls: Import a custom namespace and use its functions within

  • Thread starter Thread starter user
  • Start date Start date
U

user

Hi,

I've a custom control and here are it's contents:

mypanel.asx

--------------------------------------
<%@ Import Namespace="mylib" %>
<%@ Assembly Src="mylib.vb" %>
<script language="VB" runat="server">
Public strName as String
mylib.mysub() 'This line will cause a compilation error:
Declaration expected
</script>

--------------------------------------
How do I call mysub() inside a custom control?

Please advise!

Thanks
 
You can't simply put executable code inside a class declaration, which is
what a Control is (a class). Executable code must be in a property or a Sub
or Function.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
Back
Top