Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. I just want to greet the world... Where do I start?

I just want to greet the world... Where do I start?

Scheduled Pinned Locked Moved Web Development
csharpasp-nettutorialquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DeadWisdom
    wrote on last edited by
    #1

    I just want to make an "Hello World" for ASP.Net. A simple file that displays to the user "Hello World" in C#... With no overhead. In ASP regular, it was easy... I just did <% Response.Write "Hello World" %> What do I do in aspx??? I don't even know, exactly, how to tell it that I want to use C#. This is a bit overwhelming.

    J D 2 Replies Last reply
    0
    • D DeadWisdom

      I just want to make an "Hello World" for ASP.Net. A simple file that displays to the user "Hello World" in C#... With no overhead. In ASP regular, it was easy... I just did <% Response.Write "Hello World" %> What do I do in aspx??? I don't even know, exactly, how to tell it that I want to use C#. This is a bit overwhelming.

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      <%@ Page language="c#" runat="server" %>
      <script runat="server" language="c#">
      void Page_Load()
      {
      labelHi.Text = "Hello World";
      }
      </script>

      <html>
      <head><title>Hello</title></head>

      <body>
      <asp:label id="labelHi" runat="server" />
      </body>
      </html>

      That should do the trick :) HTH, James Simplicity Rules!

      D N 2 Replies Last reply
      0
      • J James T Johnson

        <%@ Page language="c#" runat="server" %>
        <script runat="server" language="c#">
        void Page_Load()
        {
        labelHi.Text = "Hello World";
        }
        </script>

        <html>
        <head><title>Hello</title></head>

        <body>
        <asp:label id="labelHi" runat="server" />
        </body>
        </html>

        That should do the trick :) HTH, James Simplicity Rules!

        D Offline
        D Offline
        DeadWisdom
        wrote on last edited by
        #3

        Wait... This is how you do it? Forgive me, but that seems like a hack. Isn't there a simple way to do it? I'm looking for "response.write('hello world');"... Does everything have to be done with a control?

        J 1 Reply Last reply
        0
        • D DeadWisdom

          Wait... This is how you do it? Forgive me, but that seems like a hack. Isn't there a simple way to do it? I'm looking for "response.write('hello world');"... Does everything have to be done with a control?

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          It doesn't have to be, but that is the "ASP.NET way" of doing things. If you want to use Response.Write just throw in a script block in the body block doing so :) James Simplicity Rules!

          1 Reply Last reply
          0
          • J James T Johnson

            <%@ Page language="c#" runat="server" %>
            <script runat="server" language="c#">
            void Page_Load()
            {
            labelHi.Text = "Hello World";
            }
            </script>

            <html>
            <head><title>Hello</title></head>

            <body>
            <asp:label id="labelHi" runat="server" />
            </body>
            </html>

            That should do the trick :) HTH, James Simplicity Rules!

            N Offline
            N Offline
            Not Active
            wrote on last edited by
            #5

            If you make public member variable in your code-behind class it can be used as such:

            class CodeBehind
            {
            public string mymessage = "Hello, World";

            other stuff
            .
            .
            .

            <@ codebehind=...

            <%=mymessage%>

            1 Reply Last reply
            0
            • D DeadWisdom

              I just want to make an "Hello World" for ASP.Net. A simple file that displays to the user "Hello World" in C#... With no overhead. In ASP regular, it was easy... I just did <% Response.Write "Hello World" %> What do I do in aspx??? I don't even know, exactly, how to tell it that I want to use C#. This is a bit overwhelming.

              D Offline
              D Offline
              David Wengier
              wrote on last edited by
              #6

              This should work:

              <%@ Page language="c#">
              <% Response.Write("Hello World."); %>

              -- David Wengier Sonork ID: 100.14177 - Ch00k

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups