473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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

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

Jul 18 '07 #1
1 1565
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

"user" <my************@gmail.comwrote in message
news:11**********************@z28g2000prd.googlegr oups.com...
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

Jul 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: qdm | last post by:
Below is a snippet that I'm sure is quite familiar to most ... <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" Here, I've given the XMLSchema namespace the prefix 'xsd', and with...
7
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid,...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
10
by: cykill | last post by:
Hi. I'm new to asp.net and I've been searching on the net and in book on how to use custom namespace. I've created my own custom namespace and I just need a straight answer on where to put the...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
3
by: stevong | last post by:
Hi, I've a custom user control: 'user1.ascx <script language="VB" runat="server"> Public str1 as string Dim conn as System.Data.SqlClient ' But this line hits and error. What should I do?
2
by: User | last post by:
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...
0
by: mk189 | last post by:
Hi, I am trying to create XML schema of custom markup language, enriched by XHTML. In simplified version, the XML documet could look like that: <a:alarm-manual xmlns:a="alarm-manual"...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.