Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 13th, 2009, 07:53 PM
Registered User
 
Join Date: Jan 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hello World Example Chapter 1

Hey all I am new to this whole programming thing. I tried the Hello World simple example in Chapter 1 and when I view it in my browser all it shows is the code in the browser. It does not show the date etc.

I have triple checked my code and all of the syntax is correct. Is this a problem with me or my browser. LOL

Thanks for any help this newbie appreciates it!!
 
Old January 13th, 2009, 08:38 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Well...

Does your code look like the example?

<div>
<h1>Hello World</h1>
<p>Welcome to Beginning ASP.NET 3.5 on <%= DateTime.Now.ToString() %></p>
</div>

perhaps you misspelled or mistyped something?

Since this is C# everything is CASE sensitive so make sure it reads exactly as above.

And you must view it through a web server (Preferably the Developement Server built into VS and VWD)

in the solution explorer right click your .aspx file and choose view in browser.
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old January 13th, 2009, 08:47 PM
Registered User
 
Join Date: Jan 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes that is how mine looks and I even copied and pasted yours in my page and got the same result. I just don't know what i am missing.
 
Old January 13th, 2009, 08:55 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Ok...

Copy the whole contents of the .aspx file here so we can see what's going on.

You did right click the .aspx file then choose view in browser correct? what browser is it using? the builtin browser, Internet Explorer, Firefox?
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old January 13th, 2009, 09:01 PM
Registered User
 
Join Date: Jan 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not sure how to add a file in this forum yet sorry. It opens in IE 7 when I tell it to view in browser.
 
Old January 13th, 2009, 09:05 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default No no...

you don't need to add the file, just copy the text of the file and paste it into here like you would type it normally. You can create a code box by typing

[ c o d e ]
paste the text here
[ / c o d e ]

(just remove the spacing - i did that so you could see what to type otherwise you'd see a code box)
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old January 13th, 2009, 09:11 PM
Registered User
 
Join Date: Jan 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You for the explanation here is the code.

Code:
<div>
<h1>Hello World</h1>
<p>Welcome to Beginning ASP.NET 3.5 on <%= DateTime.Now.ToString() %></p>
</div>
 
Old January 13th, 2009, 09:17 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Thanks but...

can you copy the whole file everything on the .aspx not just the code you supplied
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old January 13th, 2009, 09:53 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Your aspx file...

your aspx file should look pretty much exactly like this

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
  <div>
<h1>Hello World</h1>
<p>Welcome to Beginning ASP.NET 3.5 on <%= DateTime.Now.ToString() %></p>
</div>
    </form>
</body>
</html>
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old January 13th, 2009, 10:06 PM
Registered User
 
Join Date: Jan 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

mine looks like this: Maybe the problem is I am using VB but that is what the book said though.

Code:
 
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        &lt;div&gt;<br />
        &lt;h1&gt;Hello World&lt;/h1&gt;<br />
        &lt;p&gt;Welcome to Beginning ASP.NET 3.5 on &lt;%= DateTime.Now.ToString() %&gt;&lt;/p&gt;<br />
        &lt;/div&gt;
    </div>
    </form>
<p>
    &nbsp;</p>
</body>
</html>





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP "Hello World" Bill_Thompson ASP.NET 2.0 Basics 3 December 14th, 2007 09:38 AM
GRPS "Hello World" rodmcleay C# 0 October 11th, 2005 10:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.