473,563 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using custom namespace.

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 namespace file so I can
import them in the webpage. Can someone clarify? Thanks.

Dec 25 '06 #1
10 2639
Hi,

If (you create a custom namespace in a different project)
{
... add the project reference...
And just import the namespace top of the class....
}
else if (you created custom namespace in same project)
{
start using it,... with full qualified
name or import.... in top of the class...
}
Thanks
Masudur

cykill wrote:
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 namespace file so I can
import them in the webpage. Can someone clarify? Thanks.
Dec 25 '06 #2
But where do I put the namespace files? I'm using notepad as my editor.
I'm creating each individual asp page and put them all in a folder. do i
put it in the wwwroot folder? Thanks.


Sun, 24 Dec 2006 21:58:32 -0800, Masudur wrote:
Hi,

If (you create a custom namespace in a different project) {
... add the project reference...
And just import the namespace top of the class....
}
else if (you created custom namespace in same project) {
start using it,... with full qualified name or import.... in top of
the class...
}
Thanks
Masudur

cykill wrote:
>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 namespace file so
I can import them in the webpage. Can someone clarify? Thanks.
Dec 25 '06 #3
"cykill" <il*******@spam .netwrote in message
news:pa******** *************** *****@spam.net. ..
But where do I put the namespace files?
What do you mean by "the namespace files"? What "files" are you talking
about here...?
Dec 25 '06 #4
cykill,
There is no such animal. namespace is a way of categorizing classes and
other objects (Enums, structs, etc) so that you can disambiguate between
classes of the same name. For example:

namespace MyCustomNamespa ce.Data
{

public class SqlClient
{
.....
}

}

There is a SqlClient class in the .NET Framework already. By specifying your
custom namespace, you can still have such a class of your own invention, and
disambiguate with "MyCustomNamesp ace.SqlClient"

Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"cykill" wrote:
But where do I put the namespace files? I'm using notepad as my editor.
I'm creating each individual asp page and put them all in a folder. do i
put it in the wwwroot folder? Thanks.


Sun, 24 Dec 2006 21:58:32 -0800, Masudur wrote:
Hi,

If (you create a custom namespace in a different project) {
... add the project reference...
And just import the namespace top of the class....
}
else if (you created custom namespace in same project) {
start using it,... with full qualified name or import.... in top of
the class...
}
Thanks
Masudur

cykill wrote:
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 namespace file so
I can import them in the webpage. Can someone clarify? Thanks.
Dec 25 '06 #5
ok. if you were to create your example of classes, where do you put it so
other asp.net code can use it?


On Mon, 25 Dec 2006 05:09:00 -0800, Peter Bromberg[ C# MVP] wrote:
cykill,
There is no such animal. namespace is a way of categorizing classes and
other objects (Enums, structs, etc) so that you can disambiguate between
classes of the same name. For example:

namespace MyCustomNamespa ce.Data
{

public class SqlClient
{
....
}

}

There is a SqlClient class in the .NET Framework already. By specifying your
custom namespace, you can still have such a class of your own invention, and
disambiguate with "MyCustomNamesp ace.SqlClient"

Peter
Dec 25 '06 #6
I guess I just want to know where to put all my class files so that I can
use them with other code. I take it that I can't put them in any
directory like c:\temp? Sorry if this has been confusing. I don't quite
know how to explain it. I'm new to .net stuff. I usually do java stuff.
Java has a directory called "classes" to put all your custom classes. And
if I want to create directories under the directory "classes", like
"classes/mycustomproject/dbqueries", I can just put them in there an
import them in my code like mycustomproject .dbqueries.*. Sense? What's
the asp.net equivalent?



On Mon, 25 Dec 2006 09:12:36 +0000, Mark Rae wrote:
"cykill" <il*******@spam .netwrote in message
news:pa******** *************** *****@spam.net. ..
>But where do I put the namespace files?

What do you mean by "the namespace files"? What "files" are you talking
about here...?
Dec 25 '06 #7
"cykill" <il*******@spam .netwrote in message
news:pa******** *************** *****@spam.net. ..
ok. if you were to create your example of classes, where do you put it so
other asp.net code can use it?
Anywhere in your project.
Dec 25 '06 #8
"cykill" <il*******@spam .netwrote in message
news:pa******** *************** *****@spam.net. ..
>I guess I just want to know where to put all my class files so that I can
use them with other code.
Ah - OK.
I take it that I can't put them in any directory like c:\temp?
No - they need to be within your project's folder structure.
Java has a directory called "classes" to put all your custom classes. And
if I want to create directories under the directory "classes", like
"classes/mycustomproject/dbqueries", I can just put them in there an
import them in my code like mycustomproject .dbqueries.*. Sense? What's
the asp.net equivalent?
You can create a folder called 'classes' if you like, but it has to be
within your project's folder structure.

You say you're using Notepad to do this - is there any *specific* reason for
this?

If not, I strongly suggest you do yourself a *huge* favour and download
this: http://msdn.microsoft.com/vstudio/express/vwd/ - it's completely free,
and will make your life so much easier...

If you need database support, download this:
http://msdn.microsoft.com/vstudio/ex...l/default.aspx - again, it's
completely free.
Dec 25 '06 #9
No specific reason of using notepad. I'll look into visual studio
express. Didn't know there was a free version of VS out there. Can I put
the class files in c:\inetpub\wwwr oot as those files will be used in my
web application? Thanks.

On Mon, 25 Dec 2006 16:53:21 +0000, Mark Rae wrote:
"cykill" <il*******@spam .netwrote in message
news:pa******** *************** *****@spam.net. ..
>>I guess I just want to know where to put all my class files so that I can
use them with other code.

Ah - OK.
>I take it that I can't put them in any directory like c:\temp?

No - they need to be within your project's folder structure.
>Java has a directory called "classes" to put all your custom classes. And
if I want to create directories under the directory "classes", like
"classes/mycustomproject/dbqueries", I can just put them in there an
import them in my code like mycustomproject .dbqueries.*. Sense? What's
the asp.net equivalent?

You can create a folder called 'classes' if you like, but it has to be
within your project's folder structure.

You say you're using Notepad to do this - is there any *specific* reason for
this?

If not, I strongly suggest you do yourself a *huge* favour and download
this: http://msdn.microsoft.com/vstudio/express/vwd/ - it's completely free,
and will make your life so much easier...

If you need database support, download this:
http://msdn.microsoft.com/vstudio/ex...l/default.aspx - again, it's
completely free.
Dec 26 '06 #10

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

Similar topics

3
25243
by: Todd Schinell | last post by:
Back in July, Jeffery Tan posted this: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=OWOTdf0VDHA.2296%40cpmsftngxa06.phx.gbl In response as to how to get click events from a user control to invoke a method in the parent form. This code doesn't seem to work for me, I've tried it a number of times with very simple test...
2
2575
by: clintonG | last post by:
Are developers still using namespaces in their code for pages or is this practice no longer neccessary for pages? I don't see the rationale here. except perhaps for controls that are comprised of compiled assemblies with methods and properties that may cause conflicts with other classes. What is your current practice for 2.0 development when...
5
3146
by: Marcel Gelijk | last post by:
Hi, I am trying to create a User Control that is located in a seperate class library. The User Control contains a textbox and a button. The page generates an exception when it tries to access the code variable that are supposed to be linked to the contained controls. It runs fines when everything is contained in a single web form project....
1
5627
by: Hani Atassi | last post by:
I am trying to add a resource file (resx) to my project in VB.NET. The namespace of the file is always equal to (RootNameSpace) of the project. This is even if I set the value "Custom Tool Namespace" on the file. It seems that it has no affect! How can I specify a custom namespace for a resource in a VB.NET project.. It's much more flexible...
1
2126
by: Ankur Goenka | last post by:
Hi, I am trying to include two proxy classes (from two different web services say Namespace.Service1 and Namespace.Service2) in a project (C# Class lib). These webservice internally use (as input or return) custom classes' objects e.g. userinfo, customerinfo etc. When i generate the proxy classes for these services using wsdl, the...
1
2048
by: Ryan | last post by:
I am trying to log events to SQL Server instead of the computers event log, but, although I get no errors, I have no luck. The webevents_events table is empty. I have a custom event that I am raising (passwordchange), and can see it beign raised successfully...just it seems to go nowhere. I have run aspnet_regsql to setup the database to...
2
2998
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 language=vb runat=server>
0
3351
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" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="alarm-manual alarm-manual.xsd" <h:p>Text...
6
1869
by: tshad | last post by:
I was looking at a page that showed how to set up a custom event and it seems to work ok. But I am not sure how I would use it. How would I subscribe to it. There is actual action (such as pressing a button or changing text in a textbox). It gets set up and on the user control on my web page I can see the event from intellisense. So it...
0
7583
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
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. ...
1
7642
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...
0
5213
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...
0
3643
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
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
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.