Then what is the use of Import tag.
<% Import namespace = "abc" %>

Dinesh
----- Original Message -----
From: "Mitch Denny" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 26, 2002 12:09 PM
Subject: Re: [DOTNET] How to run a Hello world in .NET Framework


> Dinesh,
>
> As Paul has rightly pointed out. The Inherits attribute
> on the @ Page directive requires the full class name. FYI
> .NET doesn't really have any concept of namespaces, if
> you look at the IL for an application all the class names
> are fully qualified:
>
>         System.Security.Cryptography.RSACrypoServiceProvider
>
> Not:
>
>         RSACryptoServiceProvider
>
> Namespaces are essentially syntactic sugar provided by
> certain languages (namespaces need not be implemented in
> very languages) to help the programmer by saving typing,
> and help the compiler by disambiguating type names.
>
> ----------------------------------------
> - Mitch Denny
> - [EMAIL PROTECTED]
> - +61 (414) 610-141
> -
>
> -----Original Message-----
> From: The DOTNET list will be retired 7/1/02
> [mailto:[EMAIL PROTECTED]] On Behalf Of Dinesh Upare
> Sent: Wednesday, 26 June 2002 16:13
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] How to run a Hello world in .NET Framework
>
>
> But if I create a namespace in cs file. Then the aspx file is not able
> to load the type HelloWorld.
>
> I modified the component as follows -
>
> using System;
> using System.Web;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> namespace mitch
> {
>         public class HelloWorld : System.Web.UI.Page
>         {
>
>                 protected override void OnLoad(EventArgs e)
>                 {
>
>                         this.Response.Write("Hello World!");
>
>                 }
>
>                   public string PrintName()
>                  {
>                        return "Dinesh + .NET";
>                   }
>
>         }//class ends
> }//namespace ends
>
> I tried to use this component in aspx file but the runtime is not to
> load HelloWorld Type.
>
> I wrote the following line in your aspx example
> <%@ Import  namespace ="mitch" %>
> Then followed your code
>
> Then I wrote a web.config file  then i added assembly there.
>
> But then the runtime able to read namespace but not the Type
> "HelloWorld" .
>
> Could you please write the code for aspx file if there was a namespace
> in your example?
>
> Thanks
>
> Dinesh
>
>
>
> ----- Original Message -----
> From: "Mitch Denny" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 26, 2002 7:35 AM
> Subject: Re: [DOTNET] How to run a Hello world in .NET Framework
>
>
> > Mathew,
> >
> > The process of developing with the .NET Framework would be alot easier
>
> > if you downloaded the entire SDK, on the download page at the ASP.NET
> > site, download the second option, the one you have is just the
> > redistributable:
> >
> >         http://www.asp.net/download.aspx
> >
> > You can do some things with just the redist but you don't
> > get any documentation which is really valuable, its really tuned for
> > runtime, not development.
> >
> > Anyway, in order to do a hello world sample:
> >
> >         using System;
> >
> >         public class HelloWolrd
> >         {
> >
> >                 public static void Main()
> >                 {
> >
> >                         Console.WriteLine("Hello World!");
> >
> >                 }
> >
> >         }
> >
> > You compile this with the following command:
> >
> >         csc.exe /reference:System.dll HelloWorld.cs
> >
> > It will produce an executable called:
> >
> >         HelloWorld.exe
> >
> > If you have trouble compiling, the path could be the
> > issue, you may need to add the following to your path:
> >
> >         C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705
> >
> > Building a similar HelloWorld example using ASP.NET is a little bit
> > more involved but quite simple once you get the hang of it. When you
> > use code behind there are two files that you need to have, the *.aspx
> > file and the *.aspx.cs file, in this example:
> >
> >         HelloWorld.aspx
> >         HelloWorld.aspx.cs
> >
> > Note that what you name the code behind file is totally
> > up to you, but this is the convention that VS.NET uses. The contents
> > of the *.aspx file is as follows:
> >
> >
> >         <%@ Page Inherits="HelloWorld" Language="C#" %>
> >
> >         <html>
> >
> >                 <head>
> >
> >                         <title>HelloWorld</title>
> >
> >                 </head>
> >
> >                 <body>
> >
> >                         <form runAt="server">
> >
> >                                 <asp:literal id="Message"
> > runAt="server" />
> >
> >                         </form>
> >
> >                 </body>
> >
> >         </html>
> >
> > And the *.aspx.cs file is:
> >
> >         using System;
> >         using System.Web;
> >         using System.Web.UI;
> >         using System.Web.UI.WebControls;
> >
> >         public class HelloWorld : System.Web.UI.Page
> >         {
> >
> >                 protected override void OnLoad(EventArgs e)
> >                 {
> >
> >                         this.Message.Text = "Hello World!";
> >
> >                 }
> >
> >         }
> >
> > Copy the HelloWorld.aspx file to the C:\Inetpub\wwwroot directory on
> > your computer (I am assuming that you have IIS installed), then
> > execute the following command on the *.aspx.cs file:
> >
> >         csc.exe
> >                 /reference:System.dll
> >                 /reference:System.Web.dll
> >                 /target:library
> >                 /out:HelloWorld.dll
> >                 HelloWorld.aspx.cs
> >
> > That will produce a file called HelloWorld.dll, you
> > need to copy that file to the bin directory under your
> > IIS application, in this case:
> >
> >         C:\Inetpub\wwwroot\bin
> >
> > You may need to create that directory if you haven't
> > gone through this process before. Once you have done
> > this then you can request the page at the following
> > URL:
> >
> >         http://localhost/HelloWorld.aspx
> >
> > Anyway, that should get you started.
> >
> > ----------------------------------------
> > - Mitch Denny
> > - [EMAIL PROTECTED]
> > - +61 (414) 610-141
> > -
> >
> > -----Original Message-----
> > From: The DOTNET list will be retired 7/1/02
> > [mailto:[EMAIL PROTECTED]] On Behalf Of Mathew James
> > Sent: Tuesday, 25 June 2002 17:12
> > To: [EMAIL PROTECTED]
> > Subject: [DOTNET] How to run a Hello world in .NET Framework
> >
> >
> > Hi all,
> >
> >   I have recently downloaded .NET Framework(21 MB) from Microsoft site
>
> > and installed in my PC (Win2k). Now How should I start to run a small
> > application say (Hello World) with a small content in a code behind
> > page also.
> >
> > Please Help me !!
> >
> > Thanks in Advance
> > Mathews.
> >
> > You can read messages from the DOTNET archive, unsubscribe from
> > DOTNET, or subscribe to other DevelopMentor lists at
> > http://discuss.develop.com.
> >
> > You can read messages from the DOTNET archive, unsubscribe from
> > DOTNET, or subscribe to other DevelopMentor lists at
> > http://discuss.develop.com.
> >
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET,
> or subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to