Search Altered Pixels.net::

.NET Articles ::

  • Detecting Mobile Browsers

    Posted on :: Nov 30

    It's becoming more and more common that Users are accessing your website from a mobile web browser (like that from an IPhone, Blackberry, Android or other mobile device). It's also becoming more prevelant that you need to start supporting and developing for the mobile platforms. But how would you begin?

    [Read more →]

  • IE 8 Need to knows...

    Posted on :: Nov 9

    Reports on IE8 Bugs, CSS 2 and CSS3 Display issues, IE7 Compatibility Mode and how to render your pages like IE7

    [Read more →]

  • Preventing SQL Injection in .NET

    Posted on :: Jun 12

    Over the past few weeks there have been reports and commentary about SQL injection attacks being launched against both classic ASP and ASP.NET sites.

    Included in this post are VB.NET and C# samples that can be used to screen incoming query-string, form and cookie values for potential Sql injection values.  However because valid input data varies from website to website, it is not possible to write a one-size-fits-all screening mechanism.  You can modify the sample code included in this post to tighten or loosen the character sequences as appropriate for your website. 

    Also as a reminder, if a website makes heavy use of dynamically constructed Sql (as opposed to parameterized Sql or parameterized stored procedures) it is a best practice to escape all single quotes contained in un-trusted web input.  Since it is not possible to make this replacement using the HttpModule/BeginRequest approaches shown below, you can instead scrub a website's code and perform the escaping in all places where dynamic Sql is being built.

    [Read more →]

  • Data Types in C#

    Posted on :: May 5

    Many .NET programmers still do not realize the difference between Primitive, Reference and Value types, or even do not know what they really are or how to use them correctly. Misuse of any type can lead to subtle bugs that are very hard to find. It is very important to understand the different types that .NET Framework supports. In this article, I am going to talk about these different types briefly.

    [Read more →]

  • Obtaining a Type Object with Object.GetType()

    Posted on :: May 5

    We can obtain an instance of the Type class in a variety of ways. However, the one thing we cannot do is directly create a Type object using the new keyword, as Type is an abstract class. The Object.GetType method, the typeof operator, and various methods of the Assembly object return a Type object. GetType is a member of the Object class, which is the ubiquitous base class. Therefore, GetType is inherited by .NET types and available to all managed instances. Each instance can call GetType to return the related Type object. The typeof operator extracts a Type object directly from a reference or value type. Assembly objects have several members that return one or more Type objects. For example, the Assembly.GetTypes method enumerates and returns the Types of the target assembly.

    [Read more →]