i guess sql injection is nothing new but i thought this sql injection cheat sheet was still interesting.

http://ferruh.mavituna.com/makale/sql-injection-cheatsheet/

1. Close Visual Studio if already open
2. Open regedit
3. Go to [HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\Text Editor
4. Create a new string value and call it 'Guides'
5. Set the guides by specifying an RGB color and the location of the lines. for example:

Guides = RGB(224,224,224) 4, 8, 12, 16, 20

The above will give you lightly colored grey lines. You can change this to whatever you prefer by adjusting the RGB values contained in the brackets.

6. Open VS2005 and you will see the lines.


I've been having some fun writing a basic HttpHandler to improve my website's visibility to the search engines. There are a few good free URL rewriting engines out there but I thought it would be a good exercise to do this one myself, just for the sake or learning something new.

I am a big fan on using extension-less Urls where possible, ie www.mydomain.com/somepage. In order to do this properly one must make sure that wildcard extensions (.*) are mapped property in IIS to allow this to happen.

You will have to map the wildcard extension to the asp.net worker process so that all requests are mapped to asp.net

When formatting a bound column in a gridview I noticed that nothing was happening until I set the HtmlEncode Property to False. I believe that by default it is set to true for security reasons.

I was tasked to build an rss reader the other day and created a Datalist to display the output. I wanted to display page numbers but then realised that the datalist doesn't have any built in functionality for paging (like the DataGrid and GridView). I was faced with the prospect of rolling my own until I realised that most of the work had already been done for me with the PagedDataSource class! This neat class gives me all of the same functionality as native paging, and was easy to setup. It includes all of the important ingredients to do my own paging such as properies for.....PageSize, PageCount, IsFirstpage, IsLastPage etc. Here is a chunk of my code....

PagedDataSource pagedItems = new PagedDataSource();

pagedItems.DataSource = myArrayList; //the datasource
pagedItems.AllowPaging = true;
pagedItems.PageSize = maxItems;
try
{
pagedItems.CurrentPageIndex = Int32.Parse(Request.QueryString["page"]);
}
catch (Exception ex)
{
pagedItems.CurrentPageIndex = 0;
}
lblPages.Text = "";

if (pagedItems.PageCount > 1)
{
for (int x = 1; x < pagedItems.PageCount + 1; x++)
{
lblPages.Text += "
+ "page=" + (x - 1) + ">" + x.ToString() + "";
}
}

Welcome to my blog. After several years of programming I ashamedly admit that this is my first blog. I've been meaning to get one for ages now.

I'm sure many of you can relate to having good intentions to do something but never actually getting around to doing it. I figured enough was enough, and that I would commit to getting started. Thanks to www.geekswithblogs.net for generously offering free blog space and a kick-ass blog community.

I hope to use this blog to post code about programming issues that I solve, or anything interesting that I come across. I figure it will serve as a code repository if I ever need to jog my memory, and at the same time hopefully offer something useful back to the .NET developer community.

Anyway, I'm looking forward to banging out a bunch of posts and even getting some feedback with a bit of luck.

News



Archives

Post Categories

Friends

Other Blogs

Syndication: