Weblog Of Nirandas | home

Developer From INDIA

Stop trying to inject SQL into my blog!

clock June 28, 2008 16:22 by author

Please stop attacking as I ensure you that you would not succeed in doing so. Here is the IP which is trying to SQL inject my blog.

  1. 87.118.124.3
  2. 87.118.116.150

I will add to this list as I get more bad IP's

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


asp.net pages and proper titles

clock June 26, 2008 17:21 by author

web sites generally show the section of the site you are in by adjusting the title of the page. For example "nirandas >> blog", "Weblog of Nirandas >> asp.net pages and proper title" etc. There is a common part and a part which changes according to the section your currently browsing. Now developing asp.net sites, you only got a title property to set. The simple thing to do would be to setthe the complete title every time you change the title. Like this.Title = "Nirandas >> Profile of Nirandas"; Surely not elegant enough.

An alternative and more clean solution is to use a common base page for all of your pages and write some code to format the title according to your need. For example you could have a property named Heading in the base page and all of your page set the heading as required. Now the interesting part, your title can be something like this "Weblog of Nirandas >> {0}". And our code in the page's PreRender Event can set the title after formatting the heading using the title. Like

this.Title = string.Format(this.Title,this.Heading);

More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Useful extension methods for string class specially in asp.net

clock June 21, 2008 10:12 by author

Here is the class containing some of the extension methods which I always use in my C#.net 3.5 website projects. The class contains 5 methods as follows.

  1. public static string FromLeft(this string str, int length) Returns the specified number of characters from the start of the string.
  2. public static string FromRight(this string str, int length) Returns the specified number of characters from the end.
  3. public static string MakeSEOFriendly(this string str) Makes the string seo friendly by only allowing following characters [a-z0-9,-_].
  4. public static string HtmlEncode(this string str) Returns the html encoded version of the string (just a wrapper).
  5. public static string HtmlDecode(this string str) Returns the html decoded version of the string (just a wrapper).

All methods will return an empty string ("") if the string on which it gets called is an empty string or is a null string (String.IsNullOrEmpty()).

Code follows

More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Use AccessibleName property for better accessibility support in your .net applications

clock June 15, 2008 13:41 by author
Always set the AccessibleName property for every important Control while developing .net desktop applications. This will make sure that even the screen reader users will be able to use your application correctly. And your applications will be more accessible.Many times, you would use any image for the Button Control and leave the Text property blank, but users who rely on the Text property to know the job of the Button will not be able to use it properly.Almost all of the modern screen readers have good support for MSAA. And they would make use of the AccessibleName property for describing the control to their users.You should set a short and concise value for this property, just as you would set the Text property for a label describing the control. Even if you have labels describing the control, you should use AccessibleName property as 1. you can provide targeted info for the screen reader users and 2. sometimes the proper label may not get associated with the Control for which it was intended, making understanding the fields more difficult.You can use the AccessibleName property to provide a highly descriptive environment to the users of screen reader technology as it does not add any unwanted info for the normal users and provide a better experience for the VI users. And if possible, testing your apps with any screen reader software will certainly insure the accessibility of the application.Happy coding!
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Ways to set short cut keys for controls on a windows forms .net application

clock June 11, 2008 06:55 by author

Setting short cut keys for menus, buttons etc are very easy in the .net framework, you just have to set the ShortCut property for menu items. And for buttons etc, you can indicate the access key to be used for the control by putting a & sign just before the letter which should be used as the access key like, setting the text of the button control to "&Open" would set the shortcut key "Alt+O" for the button. However, if you want use other key combinations for the shortcut keys like Ctrl+a, Ctrl+F10 etc, for any controls other than menus or if you want to provide shortcut keys for textbox, you can't simply set any property or use the & sign to indicate it.
More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Plugin updates

clock June 9, 2008 13:49 by author

Today I updated my blog with 2 plugins. First is an update of zdstats (Statistics plugin for wordpress) and the second one is an installation of a new plugin "subscribe to comments".
More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Who Am I?

I am Nirandas - a developer from INDIA

Sign in