By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,491 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,491 IT Pros & Developers. It's quick & easy.

How to access namespace from custom user controls?

P: n/a
Hi,

I have a custom user control. How do I write the script in a way which i can
import custom namespace within the custom control? Please advise..

Thanks!

mycontrl.ascx

<script language=vb runat=server>
Mylibrary.mysub()
</script>

Hello world


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Jul 21 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
User,
An ASCX UserControl is not a "Custom Control". Custom Control is a new name
for Server Controls which do not have any "Page" like component such as .ASCX
files.

Perhaps you could be a little more clear about exactly what you want to do
here?
Your ASCX User Control will need to have a reference to the namespace where
MyLibrary.MySub resides.

Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com

"User" wrote:
Hi,

I have a custom user control. How do I write the script in a way which i can
import custom namespace within the custom control? Please advise..

Thanks!

mycontrl.ascx

<script language=vb runat=server>
Mylibrary.mysub()
</script>

Hello world


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Jul 21 '07 #2

P: n/a
Thanks Peter,

I guess it's called a User Control?

<%@ Import Namespace="Functions1" %>
<%@ Assembly Src="Functions1.vb" %>
<script language="VB" runat="server">

MyLib.CheckLogin() ' This line hit errors

</script>

Hello World

But i will hit with a

Compiler Error Message: BC30188: Declaration expected.

CheckLogin() resides in Functions1 namespace.

Please advise.

Thanks
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yohohhoandabottleofrum.comwrote
in message news:34**********************************@microsof t.com...
User,
An ASCX UserControl is not a "Custom Control". Custom Control is a new
name
for Server Controls which do not have any "Page" like component such as
.ASCX
files.

Perhaps you could be a little more clear about exactly what you want to do
here?
Your ASCX User Control will need to have a reference to the namespace
where
MyLibrary.MySub resides.

Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com

"User" wrote:
>Hi,

I have a custom user control. How do I write the script in a way which i
can
import custom namespace within the custom control? Please advise..

Thanks!

mycontrl.ascx

<script language=vb runat=server>
Mylibrary.mysub()
</script>

Hello world


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Jul 21 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.