Today I have mostly been learnin'...

Nov 18 2005

...ASP.NET.

After installing a gigabyte’s worth of .NET Frameworks, SDKs, and various other Microsoft-approved gubbins, I’ve been ploughing through that classic of modern literature, ASP.NET Programming With Microsoft Visual Basic .NET Step By Step.

The first thing that strikes you about .NET development is how damn easy it makes it all. One page, one form control, a couple of lines of code, compile it and shazam! Magically you have created a system for passing data securely between pages and reacting to state changes.

Unfortunately some of the code is stuck in the dark ages – look at this bit of Javascript that is auto-generated if you specify a change event on a form element:

  1. function __doPostBack(eventTarget, eventArgument) {
  2. var theform;
  3. if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
  4. theform = document.forms["Form1"];
  5. } else {
  6. theform = document.Form1;
  7. }
  8. theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
  9. theform.__EVENTARGUMENT.value = eventArgument;
  10. theform.submit();
  11. }
  12. Download this code: /code/postback.txt

Nice, ain’t it? With browser-sniffing and everything.

And the default layout for building web forms is absolute positioning, so all your text elements are created as spans with inline styles to position them on an imaginary grid.

Of course it’s only the first day of playing with it, and I’m sure there are ways to specify things you want it to do or not do; but it certainly doesn’t fill me with confidence (or enthusiasm to learn more, for that matter) to come across stuff like that at the most basic level.

Filed under: Internet.

Technorati tags:

Digg this article

Bookmark this article with del.icio.us

Previously: Joined the Evil Empire

Next: Building a simple PHP shopping cart


Comments

Kev
1576 days ago
Good luck on getting it to validate to XHTML Strict. The next version is supposed to be better but if you’re not using ‘2005 then its a ball-ache.
#1
Andy Saxton
1576 days ago
I (read: work) bought Visual Studio.net, Beginning ASP.net with VB.net 2003 and ASP.net Databases using VB.net.

I gave it up after a week or so. Just didnt like it. Don’t know why as I am a classic ASP developer by trade. I was put off about horror stories of inaccessible tag soup. I do have to say, with the exception of Karova Store, I haven’t been impressed to be honest.

Let me know how it goes and I may give it another go.
#2
Matthew Pennell
1576 days ago
I’m using it at work too - hopefully it will mostly be confined to developing internal intranet systems to start with, so by the time it gets out onto the interweb we’ll have upgraded and fixed all the validation/accessibility/code issues.
#3
Karl Dawson
1575 days ago
Good luck! Try this article for a list of hints that might help you out with the tag soup?
#4
Chris Brown
1555 days ago
FYI, this page does not validate as XHTML Strict ( 5 errors). I always hate being the bubble burster.
#5
Matthew Pennell
1555 days ago
Don’t know which validator you’re using Chris, but the W3C says only 2 errors (due to a missed closing p tag in the live preview plugin), which I’ve fixed.

Don’t worry about bursting any bubbles, I’m not overly precious about validation – perhaps next time you could comment on the article instead?
#6
James Gregory
1519 days ago
Good luck to you. I’ve been working with .net for the past year (professionally) and I find it very good even if getting it to validate is a bit of a nightmare.

The dabs website is a good example of what can be done; valid too.
#7