Monday, September 26, 2011

Show Created Date in a result of search center

One of my customers asked me to put created date instead of modified. The solution which I wrote below , maybe is not beautiful, but it works.

First of all, I needed to map managed property in the Central Administration:

Search Service Application -> Metadata Property Mappings :

"New managed property" , for me it was ''CreatedDate" and I needed to map it.

I found some answer in the internet : Article ,
but in my situation it returned 1/1/1601. Therefore , mapped all of the fields from the article separately. So, for me it was Basic:15 - the right result. But for everyone it differences.

And, of course, after do it, I had to run full crawl.


When I did all these things, I needed to edit the search results web part :

1.Insert to "Fetched Properties" new Column "CreatedDate"

2.Insert to the "XSL Editor" new template for CreatedDate


It's all for this time.

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)
)