Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 September 25th, 2007, 09:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Yes.. you will have the exact same output in Firefox, IE6 or even IE7, if you parse your file and don't have any warning on it... the only part I found out that doesn't work the same way is when you output some crystal reports (and not all, only saw that problem twice, never understood why..)

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old September 25th, 2007, 10:11 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by gbianchi
 Yes.. you will have the exact same output in Firefox, IE6 or even IE7, ...

I'll qualify this a bit so we don't start a browser behavior war:

To support what Gonzalo said, you will get the same *HTML* output from ASP.NET in most browsers... However, when you start applying formatting then you are at the whim of the browser implementation for what the final layout will look like. That is an issue with the browser, not with ASP.NET.

Miko - I agree with you. Very seldom is WYS really WYG. However, something important to consider: with the understanding that different browser implementations behave differently it's reasonable to think that you aren't going to get a precise visual layout with pure HTML. You can certainly build a well designed and functional application that is still flexible to support many platforms. If that's not acceptable, then you'll have to consider using a rich internet media (flash, silverlight, etc).

An important factor to also consider here is that part of the point of using ASP.NET technology is to enable you to create dynamic pages. They'll vary by the data that drives them so you have to support some flexibility. I hope you'll find that the programming power of the .NET framework and the implementation simplicity of ASP.NET can persuade you to use it when it's appropriate and forgive it for it's less then pretty HTML output. That was a hurdle I too had to jump when I graduated to ASP.NET. But trust me, putting that obstacle behind me has made the development road considerably smoother.

-Peter
 
Old September 26th, 2007, 01:27 AM
Authorized User
 
Join Date: Sep 2007
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If I remember correctly, Visual Studio uses different renderer than IE and the rest of the Windows so you don't necessarily get what you see... But almost and that's enough for me.

Following is just my view of the situation and I have no intention to start a flame war BUT ...

The only people that seems to have problems with different rendering and outlook on different browser are those who insist on using extensive CSS "tricks" (I can't come up with better word right now). They write hundreds of lines of CSS when same thing could be achieved with some much easier way (but maybe not in so academically correct way).

When I wrote my first web page it had like 40 lines of text and something like 10 tags. Now a days you need hectic amounts of div-tags and many lines of CSS to do the same. Some could call this progression :)

Oh, did I mention I hate web pages and especially writing them? Maybe because I work as a software engineer who writes web pages or web applications for customers :)
 
Old September 26th, 2007, 01:58 AM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I know what you mean about the ugly code. You took professional pride in building a clean coded webpage and dropped an ASP.NET control in. Contrary to what you'd expect, the world's best programmers at Microsoft couldn't come up with a cleanly coded set of objects. And actually I can come up with an example where it's a problem. There was a page with XML output transformed with an XSLT file. The XML comes out in the page as one giant blob of HTML with no spaces. When you're trying to tune your XSLT to make sure you're only getting what you want, it's virtually impossible to find the empty elements, e.g. <p></p>, that tell you it's not working yet. Royal pain. Even something as simple as inserting a line break after a closing tag would be a vast improvement in a case like that.

I still use it though, you do it for the functionality. I don't use all .NET controls, I use the specific ones I have to so that I "can" code the rest cleanly myself. The other things I do is I prefer to use CSS. So rather than setting a lot of presentational properties, I set the control Id and/or CssClass properties(which become id and class attributes in the HTML respectively) and that gives me the ability to manipulate all the appearance from the stylesheets. I'm generally quite happy with the results.

The WYSIWYG display in Visual Studio isn't perfect, I won't contradict what anyone's said. However, as someone who came to Visual Studio from Dreamweaver, VS is light years ahead in terms of accurately showing you what you're going to get. And I completely agree with Eric, the extent to which the .NET controls render properly in Firefox and other browsers is pretty amazing. Microsoft did a very good job with the Visual mode. It's so easy that there are still some advanced functions I can tweak in visual view that I don't have a clue how to approach in code view. They did a good enough job that I blame myself for browser issues rather than my IDE. That isn't true when I work with Dreamweaver. ;)

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

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old September 26th, 2007, 05:22 AM
Authorized User
 
Join Date: Sep 2007
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Miko2
 However, if there is a way, as weicco pointed out, to store it in SQL Server instead of hidden input field, I'd probably like to use it that way.
Sorry man. It seems that I have lost the page where was nice, almost step-by-step, document how to do it. I guess only option is to google for it :(

 
Old September 26th, 2007, 09:09 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Miko,

I haven't played with these but there are CSS control adapters that you can add onto ASP.NET that allow you more explicit control over the emitted HTML.

http://www.asp.net/CSSAdapters/Default.aspx


-Peter
 
Old September 27th, 2007, 01:28 AM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I've seen those, but I didn't play with them for very long, because there's very little info. It seems we're not the only ones who haven't really played around with them much.;)

In general, ASP.NET is perfectly CSS friendly as long as you don't use properties that attach inline style attributes... and for the most part they're pretty obvious names. Then use tag redefinition style rules and/or rules tied to specific classes or ids in your stylesheet, e.g.

div {...}
.myWeirdDiv {...}
.myWeirdDiv p span {...}
etc.

I find that works quite well with the standard controls which have MUCH better documentation.

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

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old September 27th, 2007, 03:20 AM
Authorized User
 
Join Date: Sep 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:
I haven't played with these but there are CSS control adapters that you can add onto ASP.NET that allow you more explicit control over the emitted HTML.
Thanks! This seems like something I'm gonna play with. :)

 
Old September 27th, 2007, 07:44 AM
jminatel's Avatar
Wrox Staff
Points: 18,059, Level: 58
Points: 18,059, Level: 58 Points: 18,059, Level: 58 Points: 18,059, Level: 58
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
Default

ChronicleMaster and Miko2: For the ASP.NET CSS Friendly Control Adapters, please take a look at this book:
Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages
ISBN: 978-0-470-12448-2
http://www.wrox.com/WileyCDA/WroxTit...fContents.html
chapter 5 is (drumroll): ASP.NET 2.0 CSS Friendly Control Adapters.
I hope that will help you some! And there may be may be more in the rest of the book that helps you with some of the other needs.


Jim Minatel
Acquisitions Director
Wiley Technology Publishing
WROX Press
Blog: http://wroxblog.typepad.com/
Wrox online library: http://wrox.books24x7.com
 
Old September 29th, 2007, 11:19 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

Sweet! That really is a topic that needs more attention. I've heard people talk about how ASP.NET is going in the direction of CSS for styling. I think you have to have worked with 1.0 to appreciate it though. I'll check out the book. Thanks!

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

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to implement unicode in asp web-pages? Swetz Classic ASP Databases 0 May 23rd, 2006 12:17 AM
XSLT in VC++.NET 7.0: Output in Web Browser BigOcean XML 0 February 18th, 2005 11:27 PM
how to upload asp pages to web 222 Classic ASP Basics 1 June 10th, 2003 02:31 PM





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