Thursday, 31 January 2013

.Net Resource file - multiple designers.cs files

Open the .csproj file
find the "LastGenOutput" tag for each resource file and make sure it is <resource file name>.Designer.cs


MVC - Sending Email using Exchange Server

Add the following in the Web.config file:

<system.net>
  <mailSettings>

    <smtp from="info@mycompany.com">
<network enableSsl="false" port="25" host="mail.mycompany.com" defaultCredentials="true" />
    </smtp>


  </mailSettings>


</system.net>

Without setting "defaultCredentials" to true, you can only send email in the same domain.  When you send email outside the domain, you will receive "Mailbox unavailable. The server response was: 5.7.1 Unable to relay for whoever@notmycompany.com" error.

Monday, 28 January 2013

Tough person around you...

You can’t change a person, but you can change the way you see him/her.

You may not change the person, but it’ll change your attitude toward him/her.  Who knows? Maybe he/she’ll start to change when you start to see him/her differently!

Friday, 25 January 2013

Bible

Yes, any Bible verse can be misused, but that doesn’t make it useless!

MVC Validation - Integer types

All the fields with Integer types will be required by default unless we declare it as <Nullable>.

Thursday, 3 January 2013

C# HashSet

A HashSet holds a set of objects, in a way that it allows you to easily and quickly determine whether an object is already in the set or not.

C# HashSet class preserves the order of the elements.

The only catch of HashSet is that there is no access by indices.