Geeky Stuff
.NET Error and Solution
by Douglas McGregor on Sep.04, 2010, under Geeky Stuff
While coding, you might come accross the following error:
‘LoginView1′ is not declared. It may be inaccessible due to its protection level
The solution is to use the FindControl method. An example is below:
Dim lblMessage As Label = CType(LoginView1.FindControl("lblMessage"), Label)
Dim tbFirstName As TextBox = CType(LoginView1.FindControl("tbFirstName"), TextBox)
Dim tbLastName As TextBox = CType(LoginView1.FindControl("tbLastName"), TextBox)
Dim tbEmail As TextBox = CType(LoginView1.FindControl("tbEmail"), TextBox)
Dim tbUsername As TextBox = CType(LoginView1.FindControl("tbUsername"), TextBox)
Dim tbPassword As TextBox = CTYpe(LoginView1.FindControl("tbPassword"), TextBox)
Note to Self: How to Solve “Cannot load type” error in ASP.NET
by Douglas McGregor on Aug.04, 2010, under Geeky Stuff
This error commonly occurs when you try to install an ASP.NET application with DLL files in the bin folder.
These files do not have to be in the root (wwwroot) folder. Say I have a web application on my localhost website that has the following structure:
wwwroot (root IIS folder)
website
forum
The website folder is the root of the application you are testing locally. The solution to solving this error is to convert the forum folder to an application in Internet Information Services (IIS).
Hope that helped someone out there!
Frustration with the .NET Compiler
by Douglas McGregor on Jun.11, 2010, under Geeky Stuff
One of my ongoing projects is to connect to Facebook using Visual Basic .NET.
Getting back to it now after some time, I’ve encountered the following very annoying problem:
Type ‘Components.FacebookService’ is not defined
All the DLL’s are in the Bin folder and all the Namespaces are imported on the aspx page. At first, it looked like it was a problem with the version of the Facebook Developer Toolkit, however it worked after changing the version of the Developer Toolkit to 2.1, it worked, but when I refreshed the browser again, it went back to its usual tricks. To me this very much looks like a problem with the .NET compiler, because I noticed when I refreshed the browser there was a bit of my code missing that was definatley in the saved web page document in Dreamweaver.
I really can’t think why this should be the case, since my .NET setup is the same as any other production server setup – IIS 7.5 and .NET Framework 4. Windows 7 is up to date with the latest Windows Updates. If anyone has found a solution to this problem I’d really appreciate to hear from you.
Thanks
Douglas
Back up and running!
by Douglas McGregor on Apr.19, 2010, under Geeky Stuff
The website is finally back up and running!
As most of you know, my website is hosted on my old laptop now, so I’ve been migrating from Windows XP Home Edition to Windows Server 2003, so I’m now proudly hosted by Internet Information Services (IIS) 6. The home edition of Windows XP was doing my head in, purely because of the file sharing difficulties…. XP Home uses something called Simple File Sharing, which is very hard to turn of…. I think you have to boot in safe mode in order to turn it off. Windows Server 2003 makes all that so much easier.
It’s still amazing what I can do with computers now….. Windows 7 comes with IIS 7, but also comes with the IIS 6 manager, so I can connect to my web server from this laptop, and restart it, and edit ISAPI filters, and all that lark. I’ve discovered that I can connect remotely to my web server at home from this cafe/bar here in Glasgow, which is pretty cool… they have excellent WiFi, plus they have good food, cider, and a great atmosphere. Anyway, back to business.
I’ve spent the past couple of days trying to get IIS and Apache Tomcat to play nicely together. I’ve got the Tomcat examples working – JSP examples – but I’m finding it hard to understand how to serve simple JSP pages outside of Tomcat. I’ll get there in the end. I’m pretty good at web server administration, and I enjoy it.
Anyway, that’s all for now. Back to the old drawing board.
Cheers
Douglas
Python with SharpDevelop
by Douglas McGregor on Mar.23, 2010, under Geeky Stuff
After getting my new super laptop with Windows 7 and 500GB hard drive space, I have begun to get back into programming.
I have an idea for a project, which involves Facebook and Skype (that’s all I’m going to say just now!) and was wanting to use a programming language that I am familiar with. Since I studied Python at Uni, and I have a big thick book on it, it seemed like the logical choice.
At the moment, I’m writing a simple console application in Python, just to get back into the swing of it. When I ran the project in SharpDevelop, the console immediatley dissappeared, without giving me the chance to read it. The way to make it stay on the screen is to use the following at the end of the code:
raw_input()
This is mainly just for my future reference, but I hope it will help someone else out there who has the same issue.
