Saturday, March 20, 2010

Element Naming Techniques in ASP.NET

Last year, Daniel touched on conventions for naming elements and files, and he mentioned the one where each part of the name starts with a capital letter. I've always heard of this as "CamelCase" and that is the term I used. But he couldn't remember the name, and when I gave him CamelCase, he said that it was when the first letter of each word, other than the actual first letter, where uppercase. (txtMyTextBox)

Well, that has been bugging me every time I've thought of CamelCase over the last 12 months or so, but it shall bother me no more. According to page 105 of SitePoints "Build Your Own ASP.NET 3.5 Website..." this technique is called Pascal Casing. (DropDownList)

Wednesday, March 17, 2010

Web Hosting Comparison


This is a comparison of three web hosting services that I checked out today. I had to do this as a part of my major assignment, which involves building a website with shopping cart using ASP.NET 3.5.

The site has to run on a Microsoft server as it's using the .NET framework.

Sunday, March 14, 2010

Come and see the violence inherent in the system... Help, Help! I'm being repressed!

I've come to the conclusion that I need to go fishing. The reason I say that is that I just spent the majority of the morning smashing my head against the proverbial brick wall trying to get crap to display using session variables. The story goes like this ... (wavy going back in time cliche inserted here):

Back in week one of the diploma, we were given a lesson on "Session Variables". Unfortunately, I didn't start classes until week three, so I missed out on the collective wisdom that our resident programming guru, Rachael, had imparted to the class. (See Jake, that's how you suck up, not like your lame effort last week mate). Anywhooo, I managed to fudge my way through based on the worksheet that I printed up from Google Doc's, but for some reason I couldn't get anything to display -this was after I spent about an hour sorting out errors in my code.

So, I mucked around with the code behind file and eventually, I was able to get something to display. Success right? WRONG! I was displaying the selected index properties of the drop down lists, and not the selected item properties. Well, I mustn't have known the correct way to phrase the question when searching for the solution in my books or on Google, because adding .SelectedItem to any of my code just threw up errors.

Anyway, just before I got to the stage where my robes were rent asunder, and I covered myself with sack cloth and ashes, I discovered that I wasn't putting .Text after .SelectedItem in my global declarations.

When I was 18, I penned two phrases, which I put up on my bedroom wall:
  • If you want to run my life, pay my bills!
  • People are basically morons!
The second of those has never rung truer than it did today.

Tuesday, March 9, 2010

Data sharing with sessions.

"Session" is known as a collection object and is closely related to "Application" (also a collection object). Session state stores variables and objects for one particular user for the duration of that users current visit, while the application state shares the variables and objects of an application between all users of the application at the same time.

The session state is stored on the server and allocates each user free memory for the temporary storage of objects. Whilst session state objects will linger after the user leaves the site, the session variables will disappear after a certain period of time.

This post was written with input from dev newsgroups, and also sitepoint's "Build Your Own ASP.NET3.5 Web Site using C# & VB" by Christian Darie & Wyatt Barnett (3rd Edition) pp 178 & 187-188.