Wrox Programmer Forums
|
BOOK: Professional C# 6 and .NET Core 1.0
This is the forum to discuss the Wrox book Professional C# 6 and .NET Core 1.0 by Christian Nagel; ISBN: 978-1-119-09660-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C# 6 and .NET Core 1.0 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 22nd, 2016, 01:08 PM
Authorized User
 
Join Date: Aug 2016
Posts: 11
Thanks: 0
Thanked 2 Times in 2 Posts
Default Chapt 40: pg.1240-1241 - Form Data

When I run this example through Chrome, the Browser is not rendering a Form, but the actual string that was returned from the GetForm() method:

<form method="post" action="form"><input type="text" name="text1" /><input type="submit" value="Submit" /></form>

Also, in the Encoding example (pg. 1239-1240) it returns the string instead of interpreting the JavaScript alert:

<script>alert("hacker");</script>
 
Old December 22nd, 2016, 04:30 PM
Wrox Author
 
Join Date: Sep 2010
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts
Default

Indeed, in this case Chrome behaves different to Microsoft Edge.

HTML5 defined (at least when I checked the specs) if a page is not completely defined (with missing html/head/body elements), the browser should automatically fill that. This spec might be changed with newer updates (I think I've seen this behavior with Chrome as well).
With today's versions, Microsoft Edge supports not complete pages and renders them, and Chrome does not.
For the moment, just try these samples with Microsoft Edge.
In the next few days I'll extend the samples to return complete HTML code instead of fragments.

Cheers,
__________________
Christian
CN innovation
Visit my blog at: csharp.christiannagel.com
Follow me on twitter: @christiannagel
 
Old December 22nd, 2016, 04:47 PM
Wrox Author
 
Join Date: Sep 2010
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts
Default

Now I also tried the page using Firefox, and it behaves as expected - similar to Microsoft Edge.
Anyway, I'll add complete HTML in the next few days to have it correctly rendered in Chrome as well.

Cheers,
__________________
Christian
CN innovation
Visit my blog at: csharp.christiannagel.com
Follow me on twitter: @christiannagel
 
Old January 17th, 2017, 02:36 PM
Wrox Author
 
Join Date: Sep 2010
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts
Default

added a HtmlHelper class that creates HTML doc-type and head to make it work with Chrome as well:https://github.com/ProfessionalCShar.../master/ASPNET
__________________
Christian
CN innovation
Visit my blog at: csharp.christiannagel.com
Follow me on twitter: @christiannagel





Similar Threads
Thread Thread Starter Forum Replies Last Post
pg 301... Connecting a data source problems... richv BOOK: Beginning SharePoint 2010 Development 1 September 2nd, 2010 04:16 AM
Error 40 prasanta2expert ASP.NET 1.x and 2.0 Application Design 1 December 6th, 2006 06:04 AM
Properties in Body Tag - Pg. 40/41 jabs BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 December 5th, 2006 09:12 AM
Chapt 9, Pg 227. Error? ericfields6483 BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 October 2nd, 2005 12:46 PM
CH3, pg 96 Hidden Form Fields wadesmart BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 19 October 28th, 2003 03:18 PM





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