QA


Q&A

Q1:

Why are we building all of our ASP.NET web pages using Visual Basic as the server-side programming language?

A1:

I chose to use Visual Basic for this book because it is, in my opinion, an easier language to comprehend for developers who may be new to programming than Visual C#. Visual Basic syntax reads much more like everyday English, whereas Visual C# uses more cryptic symbols. Furthermore, Visual Basic is not case sensitive, whereas C# is case sensitive, thereby making it more susceptible to typos and other frustrating errors. For this reason, languages that are not case sensitive are typically easier to pick up for those new to programming.

Q2:

When should I choose to use static HTML elements versus Web controls? That is, if I have to display static text, should I simply type in the text or use a Label Web control with its Text property set accordingly?

A2:

For content that you know is going to be static, it's often wiser to use HTML elements as opposed to Web controls. Of course, if the content is dynamic, such as the text displayed in the Label Web control in our last example in this hour, you'll want to use a Web control.

Some developers, however, prefer to use Web controls for all content, even static content. In fact, we did this in our first example, using an Image Web control as opposed to a static <img> HTML element. If you are unfamiliar with HTML syntax, you may find it easier to use Web controls instead of having to research what HTML elements would be used (although many of the more common HTML elements are available through the Toolbox's HTML tab). There is a slight performance enhancement to using static HTML content instead of Web controls for static content, but don't let that minor impact sway your decision. Instead, use what you're most comfortable with. If you have an HTML background, you'll likely be more apt to use HTML elements for static markup; if you're new to HTML, Web controls may seem a more natural fit.




Sams Teach Yourself ASP. NET 2.0 in 24 Hours, Complete Starter Kit
Sams Teach Yourself ASP.NET 2.0 in 24 Hours, Complete Starter Kit
ISBN: 0672327384
EAN: 2147483647
Year: 2004
Pages: 233

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net