Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 December 18th, 2010, 12:02 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default No return text on "First ASP.NET Web Page"

I am really new to asp.net, I understand the basics of html and css, so I am also somewhat new to web design in total.

I have to say I love the book so far and love the website as well, everything is so well thought out.

I am using windows 7 home. Visual Web Developer 2010 express.

Chapter 1, on the second try it out, Creating Your First ASP.NET Web Page...

When I type Hello World into the text box and hit the submit button, then right click and "view source" I am missing value="Hello World" everything else is as it should be.

thank you
 
Old December 18th, 2010, 12:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you post the following:

1. The markup of the page in Visual Studio
2. The code from web.config
3. The final HTML in the browser after you hit submit.

If you post code, please paste and copy it in Notepad first to remove code coloring. Then when you paste it here, use the Code formatting button on the toolbar to wrap the code in code tags.

Finally: can you briefly describe the site's structure, and the address you see in the browser's address bar?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 18th, 2010, 01:01 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default

According to the book I should be seeing the "Hello World" text in the browser source code. I am not getting the return text from the browser to the local local server and back to the browser evidently after clicking submit.
Could it be some security setting or something.

Thank You for the response.

I hope I did this correctly:

The address is localhost:50204/Website2/ControlsDemo.aspx

Code:
1. VWD Markup

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ControlsDemo.aspx.cs" Inherits="ControlsDemo" %>

<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Submit Information" />
    </div>
    </form>
</body>
</html>

2. Web Config Code

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>

    <system.web>
        <compilation debug="false" targetFramework="4.0" />
    </system.web>

</configuration>


3. Browser Page Source Code

<!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><title>



</title></head>

<body>

    <form method="post" action="ControlsDemo.aspx" id="form1">

<div class="aspNetHidden">

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE0MDM4MzYxMjNkZNN0j0jTgLKVXRh9yX5JG+/vNvJf3MUWpDTEVco4+nYR" />

</div>



<div class="aspNetHidden">



	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwKNv6GNDgLs0bLrBgKM54rGBgC8gXIoXXITkfhn6PB96yUE+0Txrmk1UHRz8WO8mH5m" />

</div>

    <div>

        <input name="TextBox1" type="text" id="TextBox1" />

        <input type="submit" name="Button1" value="Submit Information" id="Button1" />

    </div>

    </form>

</body>

</html>
 
Old December 18th, 2010, 01:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

That's strange; everyrthing looks exactly as it should.

Which browser are you using? And do you have any security software installed? Can you temporarily disable it and see if that helps?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 18th, 2010, 02:25 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default

I changed the default browser, I was using Google Chrome. Now I switched to Internet Explorer 8 and I ctrl+f5 I get:

Directory Listing -- /WebSite2/

--------------------------------------------------------------------------------

Saturday, December 18, 2010 11:42 AM 576 ControlsDemo.aspx
Saturday, December 18, 2010 10:27 AM 284 ControlsDemo.aspx.cs
Saturday, December 18, 2010 10:24 AM 312 web.config


--------------------------------------------------------------------------------
Version Information: ASP.NET Development Server 10.0.0.0

If I click ControlsDemo.aspx, I get the correct page with the button and I enter the text Hello World and click the submit button and get the browser source code I want.

Why is it not going straight to the web page in Explorer 8 and why does it not work in Google Chrome?
 
Old December 18th, 2010, 02:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Why is it not going straight to the web page in Explorer 8
Maybe because you're not requesting ControlsDemo.aspd directly? Did you have that file open when you presses Ctrl+F5?
Quote:
and why does it not work in Google Chrome?
That's what we're trying to find out. What about the security software?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
dogfacemarc (December 18th, 2010)
 
Old December 18th, 2010, 02:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Just realized you're using Chrome. Chrome shows the original source; not the source from the postback. For more information: http://www.google.com/support/forum/...e274f6db&hl=en

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
dogfacemarc (December 18th, 2010)
 
Old December 18th, 2010, 03:02 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Thumbs up

I did just have to click in the window for the ControlsDemo.aspx to get it to go straight to the button in Explorer.

I have Eset security, I turned it off and still doesn't work in Google Chrome, I assume I have to play with the security settings in Google Chrome, they have a lot of built in security, why I like using it, I will check into that a bit later.

I will just use Explorer for now in VWD.

I think I should mark this as solved. Do you mark a thread solved?

Thank You so much for your help. The book is great, you are great.

Just saw your last post, I guess you can't use Chrome to check development problems. That link has great info.

Thanks a bunch

Last edited by dogfacemarc; December 18th, 2010 at 03:09 PM..
 
Old December 18th, 2010, 03:38 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I think I should mark this as solved. Do you mark a thread solved?
You can't, but as you found out ths forum has a Thank You feature which comes down to the same thing.

Quote:
Thank You so much for your help. The book is great, you are great.
Thank you, and you're welcome.

Quote:
Just saw your last post, I guess you can't use Chrome to check development problems. That link has great info.
Yep. I typically use IE or Firefox for development, and just test in Chrome, Opera and others.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 21st, 2010, 08:28 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default

My son stopped by and he showed me some stuff about Chrome. He is a web developer and programmer. If in Chrome, you go to Tools (the wrench next to the url/search bar), then Tools, then Developer Tools, there are a lot of great things in there for testing and checking web pages.

You can even check the post back code from there. There is a post on the link Imar posted earlier about it.

It is a bit beyond chapter one of the book, I only understood about half of what he said, but it is something I will keep in mind for later. I will use Explorer for now for the lessons in the book.

Once again thank you for all the help. I'm sure I will be back.

Mark





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET How to use Profile in "Web application" sadeghhp ASP.NET 4 General Discussion 1 October 19th, 2010 06:33 AM
ASP.NET How to use Profile in "Web application" sadeghhp BOOK: Beginning ASP.NET 4 : in C# and VB 2 October 19th, 2010 06:14 AM
Difficulties with "web.config" and "ASPNETDB" CFRham BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 2 July 3rd, 2010 10:19 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM





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