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

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
 
K

Kevin Spencer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top