Archive for April, 2007

Chapter 7 Working with ASP.NET Controls In This (Mac os x web server)

Saturday, April 21st, 2007

Chapter 7 Working with ASP.NET Controls In This Chapter What is ASP.NET, anyway? Using server controls in your pages Allowing users to create their own accounts Creating a login page Letting users change their passwords The big difference between creating a regular Web site with HTML and a dynamic Web site with Visual Web Developer mostly boils down to ASP.NET controls. ASP stands for Active Server Pages. The .NET refers to the Microsoft .NET Framework, the home of thousands of controls for all types of programmers, not just Web developers. Some readers may already know what all that means and what it s all about; some may not. For those who don t, we start this chapter with a quick overview of ASP.NET and why it s important for Web developers. What Is ASP.NET? Glad you asked. ASP.NET is essentially a set of controls for a building dynamic, data-driven Web site. To understand what that means, let s start with a (hopefully familiar) example of searching the Web using a search engine like Google. Suppose you go to www.google.com, type in something like 1966 Ford Mustang convertible parts, and press Enter. A moment later, Google sends back a page with links to a bunch of Web sites that contain those words (not to mention quite a few relevant ads). Where did that page come from? How does that work?
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services

The CSS 2.1 Specification This chapter has been (Web domain)

Saturday, April 21st, 2007

The CSS 2.1 Specification This chapter has been about using CSS style sheets in VWD, presuming you re at least vaguely familiar with CSS already. There s not enough room in this book to cover the entire CSS specification. That s a topic in itself you could learn in a class, from a book, or from the online specification and tutorials. Like the HTML specs, the CSS specs are available at the World Wide Web Consortium Web site at www.w3c.org/. The following short list shows pages specifically relevant to CSS 2.1. Check them out. Any time you invest in learning CSS is time well spent. Starting with HTML + CSS: www.w3.org/Style/Examples/011/ firstcss Introduction to CSS 2.1: www.w3.org/TR/CSS21/intro.html CSS 2.1 Specification: www.w3.org/TR/CSS21/ 122 Part II: Building Your Web Site
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision web design programs services

In the Style Builder you d choose the following (Web hosting companies)

Friday, April 20th, 2007

In the Style Builder you d choose the following categories and options: Background: Choose Transparent. Text: Choose Horizontal, Centered. Position: Choose Width property and set it to 100%. Layout: Set Allow Text To Flow to Don t Allow Text On Sides. Set Allow Floating Objects to Do Not Allow. To use the style in a linked page, first make sure the page you re editing is linked to the style sheet. Then drag the HTML Div control from the toolbox onto the page. An empty box appears and

appears at the top of the Properties sheet. Type the class name into the Class property, and press Tab. The box won t change immediately. Figure 6-22 illustrates the procedure. To center an image on the page, drag its icon from Solution Explorer into the box. To center a table on the page, click inside the box before you choose Layout.Insert Table from the menu bar. Then create the table normally. In the VWD Design view, the
box will be visible as gray lines around the object inside. But in the Web browser, no such lines are visible and the item is just centered on the page. In the HTML for the page, a picture appears as an tag within
tags as in the following example:
Ha

Figure 6-22: Drag Adding a Div. Centered box. Chapter 6: Designing with Styles 121
Note: In case you are looking for affordable webhost to host and run your web application check Vision http web server services

Using DIV styles It s worth mentioning the HTML (Web server certificate)

Friday, April 20th, 2007

Using DIV styles It s worth mentioning the HTML

tags at this point, because they re relevant to CSS styles. A div is a box or division of text, set off from the normal flow of body text. The

tag is to block styles what is to inline styles. An empty pair of

tags creates a new box in which you can place text, tables, pictures, or whatever. However, text inside the box inherits its font and virtually everything else from its parent element, most likely the tag for the page. The main reasons I mention the

element is because many of the old ways of aligning things for instance, the align= attribute are being phased out in favor of using
tags. As an alternative to manually creating and formatting a pair of

tags each time you put a centered element on a page, you could create a CSS style that already defines how you want centered elements to appear on the page. For example, the CSS style below, named DIV.Centered, ensures that any element between its tags is centered on the page, and that no text flows around the centered element. DIV.Centered { background-color: transparent; text-align: center; width: 100%; float: none; clear: both; } Figure 6-21: Applying TD.ColHead to multiple cells. 120 Part II: Building Your Web Site
Note: In case you are looking for affordable webhost to host and run your web application check Vision http web server services

How to cite a web site - When you switch back to Design view, only

Thursday, April 19th, 2007

When you switch back to Design view, only the text within the tags will be formatted with the Mono style. If you switch to Design view and the text isn t formatted as expected, either you forgot to link the style sheet to the current page, or you misspelled the class name in the Style tag. Applying element class selectors Element class selectors have a dot embedded in the name. The first part of the name defines which tag you use to apply the style. For example, here is an element-class selector named ColHead that can only be applied to table cells ( tags). TD.ColHead { font-weight: bold; font-family: Arial; background-color: #ffffcc; border-bottom: navy thin solid; } To use an element class like TD.Colhead, you have to apply the class to text that s already formatted by the HTML element, TD in this example. Because … tags define table cells, you have to start, in Design view, by clicking on text that s already in a table cell. You can take a shortcut and select the items you want to format. For example, to apply the TD.ColHead class selector to all the cells in a row, select the row as in the example at the top of Figure 6-21. The Properties sheet won t show a tag name when you have multiple elements selected. But you can still type the class name, ColHead, in the Class property for the selection, as in the center of that same figure. Press the Tab key to complete the entry, and the selected cells will take on the style, as in the bottom of that same figure. Figure 6-20: Applying a CSS class selector to an tag. Chapter 6: Designing with Styles 119
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services

Using CSS (Web hosting domain names) class selectors in VWD is a

Thursday, April 19th, 2007

Using CSS class selectors in VWD is a bit of a pain, because their names don t show up in IntelliSense menus or any drop-downs anywhere. You have to remember the names and type them yourself. For an inline style like the .Mono example, your best bet would be to enclose the text to be formatted in tags in Source view and specify the class name in the tag, as follows: text to format goes here Note that within the tag you don t include the leading dot, just the name. The class name must be enclosed in single or double quotation marks. You ll need to work directly in Source view to type the tags. But it will be easiest to find the text if you first select that text in Design view. For example, let s say in Figure 6-19 you want to display the sample code LET X = 10 in monospace. First, select that text as shown in Figure 6-19 by dragging the mouse pointer through only that text. To switch to Source view, click the Source button at the bottom of the Design surface. The text you selected in Design view is still selected in Source view, making it a little easier to find among all the other stuff that appears in Source view. Next, click a space just to the left of the first character you want to format, then manually type in the tag, as follows: VWD automatically adds the closing tag right after the opening tag. You need to move that closing tag so that it s after the text to which you want to apply the style. A simple way to do that would be to cut and paste the text so that it s between the two tags. For example, in Figure 6-20 I ve moved the sample code LET X = 10 so it s between the tags. Figure 6-19: Selecting text in Design view. 118 Part II: Building Your Web Site
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision ftp web hosting services

For example, (My web server) suppose the currently linked CSS style

Wednesday, April 18th, 2007

For example, suppose the currently linked CSS style sheet contains the H1 style shown earlier. In the current document, you select a chunk of text, and then choose the Heading 1 style from the Block Format drop-down list on the Formatting toolbar, as in Figure 6-18. The style is applied to the selected text. In Source view, the formatted text is contained in the usual pair of HTML tags, like this:

Hello World

The words Hello World take on the formatting defined by the H1 style rule in the style sheet. You don t have to do anything special to make that happen. The connection between

in the page and the H1{…} style in the style sheet is built-in and automatic. If you change the H1{} style rule in the style sheet, the change shows up in all pages automatically. Applying CSS class selectors CSS class selectors aren t associated with any particular HTML element. In a style sheet, their names are preceded by a dot, as in this .Mono class selector: .Mono { font-family: Courier New , Monospace; font-style: normal; color: navy; } Block format Selected text Figure 6-18: Applying an element style. Chapter 6: Designing with Styles 117
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision servlet hosting services

Zeus web server - Unless there are styles in the style sheet

Wednesday, April 18th, 2007

Unless there are styles in the style sheet that apply to tags already in the Master Page, you won t notice any difference. But if you switch to Source view, you ll see that VWD has inserted a link to the style sheet between the and tags near the top of the page. That link will look something like this example:
Keep in mind that only pages that have that tag near the top use the styles in the style sheet. If you create a new page from scratch, and don t specify a Master, drag the CSS file over to the page to create the link. Using Styles in a Page After you ve linked a style sheet to a page, HTML element styles will be formatted automatically. For example, if you styled the body{} element, then body text in the page takes on the style you defined immediately. As you format text in the page, any new styles will come into play as you use the element. For example, let s say you created a style for Heading 1 elements in your CSS style sheet, like this: H1 { font-size: 16pt; font-family: Arial Black ; font-style: italic; } Any text in the document that is already formatted as H1 will automatically be displayed in the new style. That is, any text between the

and

tags in the Web page will be displayed in 16 point Arial Black italic font. Exactly how you use a style rule to format new or existing content on the page depends on which type of selector defines the rule. I ll start with the easiest one, in which the selector s name matches an HTML tag (for example, as H1 or BODY). Applying CSS element selectors A CSS element selector is any CSS rule whose name does not contain a dot. The name of the selector matches the name inside the HTML tags of the element. Applying such a selector takes no real effort at all. You just apply the element as you normally would. 116 Part II: Building Your Web Site
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision ecommerce web hosting services

All those (Free web host) property: value pairs that Style Builder

Tuesday, April 17th, 2007

All those property: value pairs that Style Builder creates are straight from the online CSS specification, available at www.w3.org/TR/CSS21. Saving a CSS style sheet When you ve finished working with a style sheet, just close and save it as you would any other document. The styles you defined won t be applied to anything until you link the style sheet to a page (or Master Page), as discussed next. Linking to a Style Sheet The rules you create in a CSS style sheet are applied only to the pages to which you link the sheet. If you ve created a Master Page, you can link the style sheet to the Master Page. The styles automatically carry over to all content pages that use the Master Page. The easy way to link to a style sheet is just to drag its icon from Solution Explorer into the page you re editing. For example, to add a CSS link to a Master Page, you simply open the Master Page (by double-clicking its icon in Solution Explorer), drag the CSS file s icon from Solution Explorer to the upper-left corner of the page you re editing, and drop it there. Figure 6-17 shows an example: I m dragging a style sheet named MyStyles.css into an open Master Page named MasterPage.master. To use your style sheet in an HTML page (or an .aspx page that doesn t use the master), just open that page in Design view and drag the style sheet s icon from Solution Explorer onto the page. Drag CSS file Figure 6-17: to page Link a style sheet to a Master Page. Chapter 6: Designing with Styles 115
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision mysql hosting services

1 on 1 web hosting - When designing borders, you can choose to define

Tuesday, April 17th, 2007

When designing borders, you can choose to define all the borders at once, or just the left, right, top, or bottom margin. You can also collapse the vertical borders in a table so there s only one line and no gap between cells vertically. This only works if you re defining the style characteristics of a table element (that is, using a

tag). To collapse vertical borders in the table, click Other in left column of the Style Builder. Then, under the Tables heading, choose Collapse Cell Borders from the Tables drop-down list. Saving Style Builder choices When you ve finished choosing options from the Style Builder, just click OK. Your selections are translated into appropriate CSS property: value pairs and inserted between the curly braces for the rule. Here s a general example: DIV.BoxedText { border-right: navy thin solid; padding-right: 25px; border-top: navy thin solid; padding-left: 25px; float: left; padding-bottom: 25px; margin: 0px 25px 15px 0px; border-left: navy thin solid; padding-top: 25px; border-bottom: navy thin solid; width: 30%; background-color: #ffffcc; } To change your selections, right-click anywhere between the curly braces and choose Style Builder again. Make your changes and click OK. Remember, your style sheet can contain as many, or as few, style rules as you like. Padding Margin Figure 6-16: Margins, padding, and borders for a table. 114 Part II: Building Your Web Site
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services