473,587 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

about custom component in ASP.net with VB.net

Hi, here is a question about custom components.
====
Before I learn ASP.net I program with ASP and VBscript, and I write
codes like this:
"<script language=vbscri pt src="usercheck. vb">"
and so I can user the .vb file again and again.

I really want to know what to do in ASP.net, or if it is true that I
can only do it with an cumtom component. If I can only do this with
component, then how?

I have been trying to write a custom component this afternoon but
failled again and again.

Thanks for anyone's help!!!!

Mar 14 '06 #1
5 1392
It depends what usercheck.vb is doing. If it has a presentation/visual
element, either custom server controls or custom user controls (much easier)
are the way to go. If it's strictly code, simply add a new class file to
your project. Files in the same project as your web site are visible
throughout all your code.

Karl

--
http://www.openmymind.net/

<pe********@yah oo.com.cn> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
Hi, here is a question about custom components.
====
Before I learn ASP.net I program with ASP and VBscript, and I write
codes like this:
"<script language=vbscri pt src="usercheck. vb">"
and so I can user the .vb file again and again.

I really want to know what to do in ASP.net, or if it is true that I
can only do it with an cumtom component. If I can only do this with
component, then how?

I have been trying to write a custom component this afternoon but
failled again and again.

Thanks for anyone's help!!!!

Mar 14 '06 #2
Just open a command window ( cmd.exe );
make sure that the .Net Framework directory is in your path
( the .Net dir is where the vbc.exe compiler is located ) ;
navigate to the directory where you have your .vb files,
and run the compile command :

vbc /t:library /out:usercheck.d ll usercheck.vb

usercheck.dll will be created/compiled in the current directory.

Copy it to the /bin directory of your application and you can call its methods.

If you want to have VS.NET use it, reference it in your project.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====

<pe********@yah oo.com.cn> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
Hi, here is a question about custom components.
====
Before I learn ASP.net I program with ASP and VBscript, and I write
codes like this:
"<script language=vbscri pt src="usercheck. vb">"
and so I can user the .vb file again and again.

I really want to know what to do in ASP.net, or if it is true that I
can only do it with an cumtom component. If I can only do this with
component, then how?

I have been trying to write a custom component this afternoon but
failled again and again.

Thanks for anyone's help!!!!


Mar 14 '06 #3
Please look at my codes:
-----------------------------
Imports System
Imports System.Web
Imports Microsoft.Visua lBasic
Namespace Admins
Public Class myConst
Public ReadOnly Property homepage() As Integer
Get
Return 0
End Get
End Property
End Class
End Namespace
-----------------------------------------------
I compiled it and reference it to my project. When I try to use it this
way:
Dim ss As New Admins.myConst
VS.net says things like "cannot find myconst in namespace admins"!

I'm new to class developing , so some questions may sound silly :(((

Thanks a lot to Karl Seguin and Juan T. Llibre!!! ^o^

Owen Wong

Mar 15 '06 #4
Are you using visual studio? 2003? 2005?

Karl

--
http://www.openmymind.net/

<pe********@yah oo.com.cn> wrote in message
news:11******** *************@j 52g2000cwj.goog legroups.com...
Please look at my codes:
-----------------------------
Imports System
Imports System.Web
Imports Microsoft.Visua lBasic
Namespace Admins
Public Class myConst
Public ReadOnly Property homepage() As Integer
Get
Return 0
End Get
End Property
End Class
End Namespace
-----------------------------------------------
I compiled it and reference it to my project. When I try to use it this
way:
Dim ss As New Admins.myConst
VS.net says things like "cannot find myconst in namespace admins"!

I'm new to class developing , so some questions may sound silly :(((

Thanks a lot to Karl Seguin and Juan T. Llibre!!! ^o^

Owen Wong

Mar 15 '06 #5
I'm using vs 2005.
Now I know why I always encounter the question: I put my .vb file in
the App_Code folder and compiled it to .dll and put the .dll file in
the BIN folder. That's why I always encounter an error. I think I can't
have the .vb file in the app_code folder and at the same time put the
compiled .dll file in the BIN folder. I sought through MSDN SDK and
didn't find an answer, but I guess I'm right, because when I moved the
..vb file and kept the .dll file or moved the .dll file and kept the .vb
file things were OK.

Thanks to you all the same! It's a great pleasure to know you guys! I'm
Owen Wong. :))))

PS: Why I can't use my name here? It always shows my email address. I
want to see my name here. ^_^

Mar 15 '06 #6

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

Similar topics

0
1550
by: ttupper | last post by:
I have made a custom control that has a property that is a custom component. When I put the custom control on a form in the designer, the propery is listed in the Properties window with a default value of (none). I then put the custom component on the form and it goes in the Component tray like it is supposed to. I then drop down the property on the custom control and the only value ni the list is (none).
1
2165
by: Ashok K Kumar | last post by:
Hi, I have a ATL Attributed DLL which exposes a COM Component. My requirement is, whenever, the DLL is registered, I also would like to add some entries to the HKLM/Softwares/CompanyName..... along with the Component registration. By default, when we create an attributed COM Component, it adds, vi_progid, progid, coclass, uuid, etc.. This is enough to register the component. But, I need to add additional registration information like...
2
1276
by: Mark Olbert | last post by:
I'm confused about the behavior of inherited WebForms under VS/NET 2003. In the Windows.Forms world, if I create a UserControl with a protected component on it, that protected component is visible (albeit locked) and accessible in any class derived from the custom control. But in ASP.NET, if I create a WebForm1 class and add, say, a DataSet component to it, it's not visible in any derived classes, even though it, too, is protected. ...
3
2328
by: DC Gringo | last post by:
Hi, I'm trying to use a custom action to modify a database (rather than create one) using the VS.NET '03's help example called "Custom Action to Create Database During Installation". I've made two modifications to the sample in the document...both are in the "Protected Sub AddDBTable" (towards the bottom). I've changed ' Creates the database.
0
1444
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and the 2nd property is a strongly typed collection class (myCollectionProperty). The collection contains a simple class (myCustomClass) which has 1 text property (TextProperty).
2
2431
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just fine. However, when attempting to assing default values as designtime in the propertygrid, nothing is working on the class object. I know that I am doing it wrong, any ideas what it is? Thanks in advance
1
6313
by: Stu | last post by:
Hi, Im using vis studio 2003 and I think wse is out of the question as clients could be using java which doesnt support it. So I managed to find some code which allows you to develop a custom soap header called by using a http module. The problem Im having is I cannot seem to get the event to raise to fire off my authenticate method in the global.asax. The module is plumbed in to my web.config file Code Below:-
0
4863
by: jwriteclub | last post by:
I feel like this must be addressed somewhere, but I cannot seem to find a good explanation, so a link somewhere (or an explanation) would be much appreciated. Using Adobe Flex Builder 2.0.1. I created a custom component based on Canvas. Added a few items and a little script logic. I saved the component in projectFolder/data_access/DataSelector.mxml and its actionscript in projectFolder/data_access/DataSelector.as. When I returned to...
1
4376
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property grid doesn't show colloections i.e. if I have a List<Objectthen the Collection is shown but when I click on the "..." button next to it nothing comes up. If I say CustomPropertyGrid p = new CustomPropertyGrid(); p.SelectedObject = new...
0
7924
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7978
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.