Create the Appropriate Kind of Facebook Profile

by Andrew Barber 11. November 2011 20:20

Many people may not realize it, but there are two primary kinds of Facebook profiles you can have; a personal profile, meant for an individual person and a Facebook page, meant for a business, organization, or public personality. Many times, I have seen personal profiles created which should have been created as a Facebook page.

This article will help show you why you shouldn't do that, and what to do if you already have.

More...

LINQ to SQL: Getting String Field Maximum Lengths With a T4 Template

by Andrew Barber 26. October 2011 09:22

If you use LINQ to SQL (link) for data access in your applications, you may have noticed one thing 'missing': an easy way to automatically get the maximum field lengths for NVarChar and similar columns. This article describes a T4 template (link) I have created for doing just that. This template generates C# code, but it would be fairly simple to convert it to produce VB code, if you prefer.

First, if you would like to download the file, here it is: L2SStringFieldLengths.zip (1.33 kb) To get detailed info on its use and creation, read on!

More...

Secure Certificates: Real-Life Problems

by Andrew Barber 8. September 2011 09:34

I just recently posted about Secure Certificates; specifically, noting why it is important to pay attention to your web browser's warnings about them. Two recent stories on cnet offer a chance to illustrate and expand on what I noted therein. First, about the pre-installed "trusted" certificate issuers (Certificate Authorities) and second, about how the address-aware nature of sites protects you, even if a site is hacked in some particular ways.

More...

Tags:

General

Why are Secure Site Certificate Warnings Important?

by Andrew Barber 6. September 2011 08:34

You may have visited a website, and seen a warning similar to the one to the right (click here for the Firefox version). What does it mean? Why is it important? Is it important?

First; yes, it is important. And it may mean you should avoid the site altogether. This article is intended to help by explaining some of the reasons you might get this warning.

More...

Tags:

General

Linq to SQL; Missing Related 'Child' Objects

by Andrew Barber 31. August 2011 01:32

Just a quick note about something that happens to me now and again when using Linq to SQL, and takes a moment to realize what's going on.

Say you are coding using Linq to SQL, in ASP.NET MVC, for example. You notice, either via intellisense or failed compilation, that a related, child object collection does not exist, even though it's in your database, the relation is set properly, and you have the entities created in the designer. So, what gives?

When this happens to me, I find that I've forgotten to designate the child table's primary key field as a primary key (and identity field) properly. Fix this, re-generate the entities, and problem solved!

Why Would Someone Hack Your Website

by Andrew Barber 17. June 2011 11:01

Many people say to themselves, "I don't need to worry too much about security for my website, because no one would ever want to hack it in the first place." In my opinion, this belief comes from a lack of knowledge of many of the reasons someone might hack a website; Maybe they see reports of big banking websites being targeted, and assume that no one would try to hack their website, because no financial information is ever posted on it.

This list should make it clear that any website at all is a potential target. If your website hasn't been targeted (yet), that's probably just a matter of luck; 'they' simply haven't found your site as of yet. This list is meant as an eye-opener to hopefully impress upon you that website security is important to consider for all websites - even yours!

More...

Remove HTML Attributes and Tags from HTML Source

by Andrew Barber 5. May 2011 17:59

This article describes a reusable, encapsulated method for removing either HTML tags or HTML attributes from a string of HTML source, while leaving the content of the tag(s) untouched. The primary use-cases for this are converting old HTML which uses deprecated syntax or tags, or providing Mobile web site content when it's possible there are certain attributes or tags in the output which you would not want on a mobile site.

The solution herein is written in C# with Regular Expressions against the .NET Framework version 3.5. It uses extension methods and a lambda expression for convenience, but those can be removed to use this solution in .NET 2.0. I leave that to the intrepid reader.

More...

CKEditor Html Helpers for ASP.NET MVC Razor/WebForms Views

by Andrew Barber 16. April 2011 10:27

This post describes a set of HTML Helpers I've written for use in an ASP.NET MVC 3 web site project, which enable you to insert a CKEditor instance with no more effort than this:

@Html.CKEditorHeaderScripts()
...
@Html.CKEditorFor(model => model.Body)
...
<input type="submit" value="Save"
 onclick="@Html.CKEditorSubmitButtonUpdateFunction()" />

This solution requires jQuery, CKEditor3, and the jQuery adapter which comes with CKEditor. It enables client-side validation to work with the editor via the helper used in the onclick handler of the submit button. It works with both Razor and WebForms view engines, and includes all of the strong-typed Html Helpers you would expect, and almost all of the weak typed ones as well. Read on to see how to use it, and download it for use in your projects.

More...

ASP.NET MVC Compilation Errors in Views

by Andrew Barber 29. March 2011 16:51

So, I'm absolutely loving ASP.NET MVC. I started with version 2, and I'm loving 3 even more - especially the Razor view engine, and all the new validation goodness. Deploying a staging site over the weekend, though, I ran into an odd error with my Razor views that I am kicking myself for not immediately connecting to errors with the WebForms view engine I used to get.

The name 'model' does not exist in the current context

WebForms view engine users will see something like this, where dynamic could instead be any custom model your application might have:

Could not load type 'System.Web.Mvc.ViewPage<dynamic>'

I'll get to the quick and easy part, and end this embarrassing episode entirely: The most likely cause of these errors is that you forgot to upload the web.config file in the /Views directory to the server, while basically getting most of the other files needed for MVC.

I'm not sure how common this situation will be for folks; I use a particular deployment strategy with some types of sites that leads to this happening once on every new MVC site I deploy this way, but I've not seen anyone else posting about this specific cause and effect. Essentially, I deploy these sites via FTPS, and I use the web.config transforms capability in Visual Studio to produce differing configurations for my development use and the staging (or even production) environments to which I'm deploying.

I purposefully, therefore, leave out web.config files in my FTP client (FileZilla) from display at all, by default. I upload the initial web.config in the root of the site from the appropriate location VS has saved the transformed version... and I almost always forget the one located in the /Views folder. This web.config does things like prevent loading the View files directly from the browser, setting the base Page or Control object for sub-items (the cause of the WebForms error) and setting the default namespaces being used in Razor views (the cause of the Razor error).

Hopefully, the act of posting this will appease the Internet Karma Gods, who will now allow me to 1) remember to copy this file, too and 2) if I still forget, remember to check this first before checking things like if MVC is installed correctly, etc, etc...

Whose Facebook Is It, Anyway? (Update)

by Andrew Barber 26. January 2011 17:18

I posted a bit ago about keeping your Facebook feed clean and clear of unwanted items. Since that posting, the interface of Facebook is quite different, so I thought I would update some items.

Topics covered in this post include:

  • Differences between your News Feed and Wall
  • Removing unwanted posts from your News Feed
  • Blocking all future updates from a user, page or application from your News Feed
  • Removing your own posts due to errors, etc.
  • Blocking application and event invitations
  • Blocking Facebook users entirely.
  • Managing/removing your Blocks and Hides.

More...

Tags:

General

Links/Profile

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent those of my partners, clients or contractors in any way.

© Copyright 2012 AndrewBarber.com