*Gurus* Derek Stone Posted December 20, 2002 *Gurus* Posted December 20, 2002 You know, ever since I started using ASP.NET in a production environment, I have stayed away from all the built-in server and HTML objects (Web Form controls), preferring to use raw HTML to display elements. In part I do this because I'm an avid XHTML promoter, which the framework doesn't abide by, but also due to the useless layers of Javascript and hidden form elements that are thrown on every page. I love the .NET backend, but the way pages are displayed just disgusts me. What I'm trying to get at, is this something a lot of us do, or am I in the minority here? Also, do you think it's a waste to be programming in ASP.NET when one chooses to ignore Web Forms? Quote Posting Guidelines
*Experts* Bucky Posted December 20, 2002 *Experts* Posted December 20, 2002 I personally enjoy using the server controls. Granted I still use many HTML elements (regular tables versus asp:table), but I think one of the best features of ASP.NET controls is their ability to adapt the the client browser. If you look at the source of a page in IE that has, for example, a DataGrid, the formatting for the rows and headers will include CSS, which IE can support. If you view it in Netscape 4.7 (God help you), the table's formatting will consist of mostly HTML attributes with minimal CSS. I'm wondering how you code the pages with regular HTML controls. It sounds like you're going against the grain of ASP.NET. It probably isn't all waste though, because there are still many features of ASP.NET that you can take advantage of. Maybe the current episode of VBTV will help you decide. :) http://www.msdn.microsoft.com/vbtv/default.asp Just my 2 cents. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
*Gurus* Derek Stone Posted December 20, 2002 Author *Gurus* Posted December 20, 2002 How do I code the pages with regular HTML? Very easily. The entire EliteVB site is done in CLASP.NET, short of one or two pages which are so self-contained that I figured I suck it up and use the Web Form elements. Keep in mind though, that both myself and Garrett still take advantage of Web Controls (our own custom made ones), Code Behinds, precompilation and of course the wonderful .NET languages, we just don't care for the visual side of ASP.NET. Comments? Quote Posting Guidelines
Moderators Robby Posted December 20, 2002 Moderators Posted December 20, 2002 I agree 100% Derek. That contract I finished last month had me doing ASP.NET and the company did not want me to use any datagrid or any databinding, so I got used to doing the HTML thing. This week I re-wrote my web site and I did exactly the same thing, I used only html tags. I put no code at all on the aspx form. I create a couple of Labels at runtime and stick all my html tags into them. I've already mentioned this in another thread, I converted 20 asp and 11 html files into 1 aspx and one vb class. Funny, I thought I was in the minority. Quote Visit...Bassic Software
*Gurus* divil Posted December 21, 2002 *Gurus* Posted December 21, 2002 I am a relative newbie to asp.net (I'm going to learn it over the Christmas break). When you guys say you use html rather than the web controls, do you mean you stick a runat="server" attribute on them so you can access them from codebehind, rather than using say an <asp:textbox> tag? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Gurus* Derek Stone Posted December 21, 2002 Author *Gurus* Posted December 21, 2002 re: divil Nope. I use Request.Form() to access form elements. For example: <% Dim strMessage As String If Request.HttpMethod = "POST" Then Dim s As String s = Request.Form("foobarTextBox") Else 'Page was not POSTed back End If %> <!-- Various header and body tags --> <form name="exampleForm" method="post" action="example.aspx"> <input name="foobarTextBox" type="text" maxlength="254" size="40" /> <input name="submitButton" type="submit" /> </form> <!-- Various footer and body tags --> In other words we don't touch the runat attribute for form elements (I do however use it for Web Controls). Quote Posting Guidelines
Garrett Sever Posted December 21, 2002 Posted December 21, 2002 Speaking of which.... I think I'll finally get around to some of those improvements I've been procrastinating on.... ;) Quote
Moderators Robby Posted December 21, 2002 Moderators Posted December 21, 2002 I also use Request.Form(), and I still use JavaScript to validate a form on the client. I use a placeholder, 2 panels and 3 labels, they are are created at runtime and hold all the data I need, sort of like a template. The CodeBehind has very little code as well, 2 functions that load and format controls, and another that receives the QueryString, then calls the approriate class. (a whole bunch of Select Cases there). Quote Visit...Bassic Software
*Gurus* Derek Stone Posted December 21, 2002 Author *Gurus* Posted December 21, 2002 See, that's where we differ. I can't stand JavaScript, period. I do all my validation server-side, where it's more secure and more options are available. Quote Posting Guidelines
Moderators Robby Posted December 21, 2002 Moderators Posted December 21, 2002 I still do the a lot of validation server-side, but for things like a blank text box, I prefer to alert the client right away. Quote Visit...Bassic Software
*Gurus* divil Posted December 21, 2002 *Gurus* Posted December 21, 2002 I agree. There's no excuse for not having everything validated server-side, but I use client-side validation too, it saves users having to wait for a postback. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Gurus* Derek Stone Posted December 21, 2002 Author *Gurus* Posted December 21, 2002 I guess I'm so use to waiting anyway (dial-up) server-side validation doesn't bother me much. I guess I can agree to a combination of both though, however redundant it may be. Quote Posting Guidelines
*Gurus* divil Posted December 21, 2002 *Gurus* Posted December 21, 2002 It may be the reason that I'm a dialup user that I'd rather everything were instant if possible :) Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.