Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

How to access namespace from custom user controls?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
User - 21 Jul 2007 15:41 GMT
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
Peter Bromberg [C# MVP] - 21 Jul 2007 18:00 GMT
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

> Hi,
>
[quoted text clipped - 15 lines]
>     ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------        
User - 21 Jul 2007 18:22 GMT
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

> User,
> An ASCX UserControl is not a "Custom Control". Custom Control is a new
[quoted text clipped - 35 lines]
>>     ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
>> ----------------------------------------------------------

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.