Wednesday, September 16, 2009

The Greatest Exception Handling

public static class CheckYourNumber
{
public static ApplicationException EvenOrOdd(int integer)
{
if (integer % 2 == 0)
{
return new ApplicationException(“The integer is even.”);
}
else
{
return new ApplicationException(“The integer is odd.”);
}
}
}

protected void Button_Click(object sender, EventArgs e)
{
try
{
throw CheckYourNumber.EvenOrOdd(Convert.ToInt32(txtIntToTest.Text));
}
catch (ApplicationException ex)
{
lblResult.Text = ex.Message;
}
}

I loved it :)

Tuesday, September 15, 2009

Change the list of file types displayed by the asp:FileUpload control

I bumped into the problem: how to change the list of file types displayed by the asp:FileUpload control and up to now, I didn't solved it.

My First Blog

So,I started.
In this blog I tend to write all, what related to programming - especially C# and ASP.Net(Update:
Sharepoint, Jquery, T-SQL,PowerShell)
)