There are a couple ways to create ASP.NET assemblies. In ASP.NET 1.1 if you coded your pages with a separate Class as the code-behind with all of your methods, etc you had to compile it before deploying to your web server.
In 2.0 ASP.NET detects any changes to the source code (in my case .cs files for c#) or in any aspx page itself and precompiles the code the first time that a page is visited.
From my experience, the nice thing about ASP.NET is that is very similar to traditional programming. You write a web page in the same way you would write a screen in a desktop app. Your button trigger event functions; you bind data to controls, etc.
If you come from a traditional programming background, it makes web development more intuitive.
I’ve done Classic ASP for over five years now, and I’m just getting into ASP.NET, but so far, I like it a lot. Next up – ASP.NET 2.0
There are advantages and disadvantages to both ASP and ASP.NET to be sure. I for one hate the whole “theme” bit with ASP.NET. It is a royal pain in the bum to use, the tutorials for using it are almost as confusing as it is, and in all honesty, there’s absolutely no need for it.
I find I have an easier time using CSS that I can write by hand just fine to control the visual aspects of page rather than rely on ASP.NET to “write the CSS for me” especially considering Microsoft’s track record for implementing CSS incorrectly.
I further find that even with ASP.NET 2.0 it wants to by default display any results from a DB in a table, which is great if it is tabular data to start with, but if it is something like an article, blog post etc you have to go to from here to the Federated States of Micronesia and back just to make it so it won’t display in table.
Granted, I am just beginning to work with ASP.NET and the C# language, and for the time being while I know my “understanding of the technology and framework” is limited, but I cannot help but feel that in Microsoft’s attempts to make some aspects of development faster and easier they have in turn made many more things much more complicated than they need to be.
Then you have clearly not understood what the “Theme Bit” is all about. It is not intended as a replacement for CSS, rather it’s complementary. How would you use CSS to introduce paging in a grid, even just change the paging size. Or changing the sort order. Or using “/” instead of a “>” as separator in a breadcrumb. Or try changing the number of columns in a vertical oriented datalist using just CSS. These are all samples of what you can do with themes, declaratively, with no code.
I’d agree that many sites do not need themes, but if you do it’s great to be able to change server-side properties which affect the html rendered. Best practice still uses CSS classes as much as possible, but CSS does have its limitations. Themes complement CSS. An oh - themes do not render a single CSS selector unless you wrote it, so they can not mess up your CSS.
That’s the default when you’re being lazy and just drops in a table from the server explorer. Well, it actually a pretty good default. If you don’t like it and is still being lazy (I am lazy - so this is not to be disrespectful) just delete the grid, drop in a FormView or DetailsView, select the datasource and watch a form being generated for you. Still not satisfied? Then edit the templates (FormView) to suit your needs.
I find ASP.NET incredibly productive. Used correctly, there’s so little code you actually has to write. The markup (view) and controller logic are cleanly separated. DataSources allows me to keep the model clean while not enlisting more overhead than needed (yes, I’m actually quite fond of ADO.NET). Provider architectures for membership, site structure etc. allows me to use standard components for login, menus, breadcrumbs, personalized content etc without loosing out on any generality. If you’re just beginning I envy you the realizations that lie ahead of you.
I stand corrected by the way. The piece I am presently at issue with is called Master Pages, or something relatively close. Now to answer your question, easy, the table header <th></th> effets are listed in CSS as are the <tr class=“odd”> and <tr class=“even”>, and alternating row colors for the output rows is done, viola. Using CSS I can manipulate just about every aspect of that tables visual layout, including width.
Javascript, or Ajax
JavaScript again, havent you seen sortable.js off of kryogenix.org? It’s been around for a while and does a dandy job of allowing you to change sort order in a table of results.
JavaScript, or Ajax again, its just a simple string replacement
I’d LOVE to see you do this using only the Master Pages technology in ASP.NET without touching or changing your output grid. I personally don’t think it can be done because “MasterPages” are functionally just controlling the visual appearance and layout of a page, thus usurping the need for CSS and that is one of the things CSS just happens to be very good at.
Furthermore, yes the MasterPages look Dandy in IE, but hit them with Safari or Opera or Even Firefox and your layout is hit or miss because we all know Micrisft’s implementation of CSS is a little off.
If you’re going to be changing number of columns in an output grid you’re going to have to fundamentally change your output element, a datagrid in this case I would think by adding or taking away a row.
Oh trust me, there is code there somewhere doing all of that, there’s no such thing as a free lunch. However, withthat said, I wouldn’t use CSS to change sort order or add another column, you can do that on the fly with JavaScript easily enough.
But Master Pages can, or at least, the few times I have tried them they have. My point being you shouldn’t need masterpages to tell your elements where on the page to layout, what color the text should be, what size it should be, etc…
I’ll try to keep that in mind later on, but I stand by my earlier statement, you can only make things just so easy, but by doing so you make other things even more difficult in the long
This Datalist is databound to an enumeration of the numbers from e.g. 0 to 20. This will produce a page with a table with 7 rows times 3 columns with the numbers in the cells.
Now consider a Theme (“Theme1”) with a single skinfile containing this declaration:
<asp:datalist runat="server" RepeatColumns="9" />
Enabling this skin for some customers will render all datalists with 9 columns. The original file was not touched. There’s more to themes/skins than this, but that goes beyond this discussion.
MasterPages
You need to read up on this. MasterPages is not a way to control the layout of a page. Rather its a way to ensure that common html is shared across multiple pages. It’s a way to ensure a consistent look across multiple pages. CSS will help with this, but CSS cannot render all of the static html of the pages. To use CSS to ensure a consistent you still need some html (e.g. div’s, span’s and - god forbid - tables) to reference the css classes. This is where masterpages comes in. Again MasterPages complement CSS, it’s not a replacement for CSS, nor was it ever intended to be.
MasterPages do not render a single style attribute, class attribute, css selector, css link, unless you put them there. Therefore, any differences between IE, FF etc. is solely your responsibility.
The believe your reference to MS “little off” CSS is a reference to the browser made by the same company. You are confusing thing here.
There are alot more problems with ASP/COM than you admit. Biggest one is the fun state known as DLL hell. COM-based apps are a nightmare to keep running compared to their .NET bretheren, mainly because of the number of machine-wide dependencies. Not to mention cryptic errors and completely random crashes that would take down the entire app server.
Debugging tools are great for complex alghorithms, and indispensable when working with multiple threads.
But for average web applications where logic is simple enough, and ussualy it is, you guys should read about Test Driven Development because there is no debugger as efficient.
TDD is great for getting the complex algorithms behaving correctly in their outward interfaces. But being able to step through some complex display logic to find the bug is invaluable. Especially when compared to the normal methods of debugging one has with PHP. Which basically amount to print_r($obj).
Although a good point vs ASP, experience tells me that the main bottleneck of almost all web applications are network bandwitdh and database access.
So having things like builtin caching mechanisims as well as the ability to easily use persistent, shared objects within your application do not help minimize network bandwith usage as well as database hits?
And whenever you have intensive alghoritms to execute in ASP, although it is hardly the case, you can always use COM objects.
Good point, though see above regarding DLL hell.
I wouldn’t say that. ADO.NET is much harder to use than clasic ADO.
The only gains you get here is on quick data binding that you can do between datasets and asp.net components.
But other than that, I watched grown men cry when they had to switch
How so? Switching database access methods can make any entrenched developer cry. ADO.NET is not intrinsically more difficult than ADO.OLD while being far more powerful and generally useful.
@Sojan80: you really need to review .NET before you bash it. Just because it provides some neat server-side mechanisims to help one handle common appearance issues which are not in CSS and methods to sort things not using Javascript does not mean it is some kind of horrible thing aimed at wiping out CSS. I have been doing CSS based .NET sites for years. While that required some real tricks to make work in 1.1, it was quite doable. I think the problem is that you have not quite made the .NET learning curve and are still fighting the system. I did this for a while myself. When one masters enough of the very complex ASP.NET stack, one will understand why .NET blows the doors off of classic ASP.
EDIT:
Missed this one
ASP.NET is good for professional web developers who want to prevent you from changing the code, in order to force you to pay them for changes. Or forcing you to accept whatever they offer (i.e. you can’t ask Microsoft to change Microsoft Word just for you no matter how much you pay them).
ASP and PHP are good for webmasters who want to modify the original code of the script they purchased or who want to build upon a good script to create something unique, and not have to pay a developer to do simple changes they can do themselves for free.
That is just a failing of your contract. Anything I contract out for always specifies that I get full, original source code and rights to modify as I see fit. In any case, a well designed ASP.NET application should handle nearly any change the end users should be making via changes in a configuration or .ASPX file.
Not to mention that, with ASP.NET 2.0, one can just go to completely on-the-fly compilation rather than just uploading the .DLLs and the content files. Which makes it like PHP or ASP.OLD with the advantage of being compiled when running under load.
This is exactly why I have stuck with classic ASP and will most likely eventually move to PHP instead of ASP.NET, if I have to move at all.
I’m not a “programmer” nor do I have the desire to be one. I consider myself a scripter, though after doing this for about nine years now my scripts can get pretty advanced.
I think sometimes the decision about “which technology is best” needs to be “which technology is right for me” instead. Then again, I don’t rely strictly on my web development skills to make a living and if I did, my feelings would probably change.
But let’s face it, there’s essentially nothing in terms of end-user functionality that can’t be done with ASP, PHP, ASP.NET, etc. They just get there in different ways.
Maybe I missed something but that iportalx.net doesn’t validate. I don’t know why it’s a great example of asp.net, but maybe I missed something.
What really disturbs me is that while I read these posts it sounds like a completely foreign language you are all talking. Totally unrelated to web programming and design. I know html/css/javascript/C/C++/assembly, I even studied asp.net for a few months, and on and on but when you start talking about asp.net, NOTHING sounds familiar and I can’t even follow it. There is something about this that is just wrong.
I recall using Visual Interdev to help me debug “Classic ASP” years ago when it was all the rage. Used it daily, along side VB6 to debug COM Objects too.
Anyway, I not looking to start a flamewar, just pointing out that there is debugging for Classic ASP.
benjymouse:
Yeah I know. I am still getting used to the terminology, so it will take a bit to get all the new terms right. Cool example though, thanks for that.
wwwb_99:
I’m not trying to bash it all. I admitted I am just getting started with ASP.NET. For instance, I know right now that what is frustrating me the most about .NET is .NET and the IDE interface aren’t making any sense to me yet, but that is primarily because I haven’t even been using it a month yet. I would imagine after 6 months or so of using it my feelings toward it will change.
For now though it just seems to be the bane of my existence, hopefully with time that will change.
.NET and the IDE interface aren’t making any sense to me yet
That’s the same problem I’ve had. It seems I have to spend as much time trying to figure out Visual Studio as I do to program or learn all the MS stuff.
I’m sure malloc() or location.href or float layouts were foreign to you at one time as well, and those may not have perfect matchups in other languages. Lots of things in the .NET framework match up with concepts in other languages like Java, they may just have a different word for it.
There’s a learning curve with any language. Someone who hasn’t gotten into Ruby on Rails probably doesn’t know what link_to_remote does either, but to call that a failing of the language/framework is disingenuous.
Lots of things in the .NET framework match up with concepts in other languages like Java, they may just have a different word for it.
That’s what I’m struggling with. Most languages that can it’s malloc but with .NET it’s … (maybe bad example but you get the point). I just have problems with things that rename the wheel.
Well, .NET and Java don’t allocate memory manually like that so it’s not an issue.
If you’re coming from a Java background, C# is downright easy because for the most part the only thing that changes is the class library you’re using. The syntax is very similar either way.