Friday, July 22, 2011

ASP.NET Menu and cross-browser compatability.

I'm not a first or last one who spends a lot of time trying to adjust code for all possible browsers. In my previous post I uploaded a code how to general multilevel menu in ASP.NET environment. In this post I would like to take some time to talk about issues with various browsers which render code differently. Therefore, we might have different presentation.

I'm not first or last one who writes how painful for developers to code and recode pieces of software only because different browsers have own standards. As many of you know, in most cases Microsoft code works OK in IE, but have some problems with Firefox or Chrome.
In my case, it did work with IE and Mozilla Firefox, but if did not work for with Chrome and Safari. No matter how I tried to adjust menu for Chrome, it did not work out. I took a simple, but it looks to me, elegant decision.

I found a site and downloaded a sample-code. I worked on this code
and made the menu look exactly like I want and plugged into my code. Therefore, now my code works with most of popular browsers without any problem.

Friday, July 8, 2011

Custom Error Pages in ASP.NET

First of all, thanks Ted for putting out useful article about this issue.

1. Make sure HTTP errors is enabled/installed in IIS (see picture)



2. Add some code in top-level web.config file. (For example, this displays an ASP.NET page when a 404 error occurs, without rewriting the URL (the visitor will still see the requested URL in the address bar))
- inside <system.webServer>-tag add:

<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/errors/pagenotfound.aspx" responseMode="ExecuteURL" />
</httpErrors>

- inside <system.web>-tag add:

<customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx">
<error statusCode="404" redirect="~/errors/PageNotFound.aspx" />
</customErrors>

3. Create 2 error-pages GeneralError.aspx and PageNotFound.aspx-page in errors-folder.
4. For example, go to SRTR and try to type in URL box something like https://securesrtr.transplant.hrsa.gov/you and hit Enter. PageNotFound must show up.

Wednesday, July 6, 2011

Problems, problems, and problems.

Calendar implementation is taking a lot more time that we initially thought. We have to synchronize SharePoint calendar (one domain) with master Outlook calendar (another domain). It's not easy as it sounds. We spent 2 days googling Internet and trying to find a solution. Finally
we found something interesting and closed to our need. It's an Exchange calendar web part written by Swiss software company which specializes in Sharepoint web parts. It's quite interesting piece of software written for SharePoint. It contains several dll-files and one web part file.

We'll see if it's going to work for us... A day later I can say: IT WORKS only with right permissions between domains.

Friday, July 1, 2011

Always something new.

Every day I learn something new and exciting. Today I found a very interesting article and video.

Who invented mathematical constant pi? According to Wikipedia,the Greek letter p was first adopted for the number as an abbreviation of the Greek word for perimeter,
or as an abbreviation for "periphery/diameter", by William Jones in 1706. The constant is also known as Archimedes' Constant, after Archimedes of Syracuse who provided an approximation of the number, although this name for the constant is uncommon in modern English-speaking contexts. Now ancient constant is going through transformation. We shall see who is right...