Re: [css-d] ASP.NET - Tableless Forms
New to this CSS world but loving it. I have seen many examples of tableless forms such as that at Dynamic Drive - CSS Library http://www.dynamicdrive.com/style/csslibrary/item/css-tableless-form/P10/ However, I cannot find anything that works with ASP.NET components such ASP:Label, ASP:TextBox etc. Is it possible to do the same thing with .Net components (new to .net as well) hi, css is applied to html tags - output of ASP.net codes. see them by browsing the page and viewing the html source using a browser. then you can create css for the tags you see. place them in a file with .css extension. for example: styles.css then in your asp.net source include the following: Dim CSSHtmlLink as new HtmlLink CSSHtmlLink.href=~/styles.css CSSHtmlLink.Attributes.Add(rel, Stylesheet) CSSHtmlLink.Attributes.Add(type, text/css) CSSHtmlLink.Attributes.Add(media, all) Page.Header.Controls.Add(CSSHtmlLink) assuming you're using ASP.NET 2.0 good luck. Virgil http://www.jampmark.com __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] ASP.NET - Tableless Forms
It seems to be a little-known fact that the W3C actually says that tables can be used to lay out (actually it says present) forms. More info here: http://developer.cmzmedia.com/?p=71 Yes, tables were not intended to lay out a whole web page but they do have legitimate uses. There's no need to throw the baby out with the bath water. Christian Ziebarth __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] ASP.NET - Tableless Forms
christi...@netscape.net wrote: It seems to be a little-known fact that the W3C actually says that tables can be used to lay out (actually it says present) forms. More info here: http://developer.cmzmedia.com/?p=71 Yes, tables were not intended to lay out a whole web page but they do have legitimate uses. There's no need to throw the baby out with the bath water. I'm not sure I'd consider it little-known, but it is often mis-quoted. First of all, the W3C specs *allow* many (nearly all) elements inside tables and table elements, not just the ones cited in that article. The issue isn't one of allowed versus disallowed, but rather of could versus should. While each of the elements mentioned in the reference page cited in the article (text, preformatted text, images, links, forms, etc.) [1] *may* go inside a table, every one of those elements can be more easily styled and more flexibly controlled using CSS-based, semantically correct HTML source. In fact, even in the specs as far back as HTML 3.2 [2], tables are permitted, though not recommended for layout. The specifications state: HTML 3.2 includes a widely deployed subset of the specification given in RFC 1942 and can be used to markup tabular material or for layout purposes. Note that the latter role typically causes problems when rending to speech or to text only user agents. Note the last line of that paragraph, which is often excluded from references citing this particular line. The use of tables for layout *typically* causes causes problems when rending to speech or text only user agents...like search engines. While the technology employed by both speech software and search engines has progressed considerably such that most of those issues are certainly lessened if not alleviated altogether, the fact remains that tables are not the best way to manage layouts of anything except tabular data, including entire pages or sites. Chapter 10 [3] of Joe Clark's book, _Building Accessible Websites_, is a perfect example of the mis-quoting (or selective exclusion) of the 3.2 spec. His book is about accessibility and yet he omits the second part of that paragraph (the one about accessibility) and very nearly recommends using tables for the layout of a web page. (Please note: BAW was written in 2002 and I'm purposefully being awfully hard on Joe Clark here. In his defense, his recent writings seem to echo the thought that tables should not be used for page *or* element layout. [4]) [1] http://www.w3.org/TR/html401/struct/tables.html [2] http://www.w3.org/TR/REC-html32-19970114#table [3] http://joeclark.org/book/sashay/serialization/Chapter10.html [4] http://alistapart.com/articles/tohellwithwcag2#WCAG-documents:travesty-failure -- !-- ! Bill Brown macnim...@gmail.com ! Web Developologist, WebDevelopedia.com -- __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] ASP.NET - Tableless Forms
On Tue, Feb 17, 2009 at 4:13 PM, Bill Brown macnim...@gmail.com wrote: christi...@netscape.net wrote: It seems to be a little-known fact that the W3C actually says that tables can be used to lay out (actually it says present) forms. More info here: http://developer.cmzmedia.com/?p=71 Yes, tables were not intended to lay out a whole web page but they do have legitimate uses. There's no need to throw the baby out with the bath water. Personally, I agree with this idea, at least for complex forms. For simple forms, a div with some input elements works just fine, and can be easily styled. Regarding ASP.Net in particular, it creates some of the most hideous HTML I've ever seen. Take a look at the output from a Treeview control and you'll see exactly what I mean. Try using the CSS adapters [1] to make your life a little easier. A little off-topic, but also of note with ASP.Net is that you can make *any* tag a server-control, just by throwing runat=server into it. Be warned that this will screw with your element IDs, but if you're not using them (or can use class names instead) it works quite well. I use ASP.Net a lot, and tend to do things like: div class='formContainer'input id='name' name='name' runat='server' class='first formElement'/input/div This will let you do this.name.Value on the server side and lets ASP manage the viewstate, while not relying on the ASP controls, so you can easily style your elements via CSS. HTH. [1] http://www.asp.net/CssAdapters/ -- Jerod Venema Frozen Mountain Software http://www.frozenmountain.com/ 919-368-5105 __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] ASP.NET - Tableless Forms
On 2009-02-16 Iain Wilson wrote: Hi All New to this CSS world but loving it. I have seen many examples of tableless forms such as that at Dynamic Drive - CSS Library [snip] However, I cannot find anything that works with ASP.NET components such ASP:Label, ASP:TextBox etc. Is it possible to do the same thing with .Net components (new to .net as well) Sure, the rendered html is label ... input ... Unfortunately IDs on form elements are useless in .net for styling as M$ gloms hierarchy into the label to (presumably) insure uniqueness. The cascade and the CssClass attribute are your friends. One _strong_ recommendation, please use the AssociatedControlID attribute to explicitly associate the labels with their related form inputs. Your screenreader users will be appreciative. HTH, -Steve -- Steve Axthelm stev...@pobox.com __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
[css-d] ASP.NET - Tableless Forms
Hi All New to this CSS world but loving it. I have seen many examples of tableless forms such as that at Dynamic Drive - CSS Library http://www.dynamicdrive.com/style/csslibrary/item/css-tableless-form/P10/ However, I cannot find anything that works with ASP.NET components such ASP:Label, ASP:TextBox etc. Is it possible to do the same thing with .Net components (new to .net as well) Thanks in advance for any assistance offered Best regards Iain Never do today what can be put off until tomorrow. Never do tomorrow what can be put off indefinitely - I plan to have a plan for the future sometime in the future __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/