Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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!!
Reply With Quote
  #2 (permalink)  
Old January 13th, 2009, 08:38 PM
Friend of Wrox
 
Join Date: Nov 2007
Location: Central Florida, USA.
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
Reply With Quote
  #3 (permalink)  
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.
Reply With Quote
  #4 (permalink)  
Old January 13th, 2009, 08:55 PM
Friend of Wrox
 
Join Date: Nov 2007
Location: Central Florida, USA.
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
Reply With Quote
  #5 (permalink)  
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.
Reply With Quote
  #6 (permalink)  
Old January 13th, 2009, 09:05 PM
Friend of Wrox
 
Join Date: Nov 2007
Location: Central Florida, USA.
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
Reply With Quote
  #7 (permalink)  
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>
Reply With Quote
  #8 (permalink)  
Old January 13th, 2009, 09:17 PM
Friend of Wrox
 
Join Date: Nov 2007
Location: Central Florida, USA.
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
Reply With Quote
  #9 (permalink)  
Old January 13th, 2009, 09:53 PM
Friend of Wrox
 
Join Date: Nov 2007
Location: Central Florida, USA.
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
Reply With Quote
  #10 (permalink)  
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>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:59 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.