Wednesday, January 20, 2010

Awesome Javascript DatePicker control

This one works like a charm! You can download it from here
Credits to Zapatec!

Showing a "Please wait..." message for slow loading pages

This is the simplest and most elegant solution I found to this problem


http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_21545558.html


I like the approach where you have an invisible DIV tag that contains your "wait image". Upon page submission/postback, you show that DIV tag client-side--before the postback occurs.

Here are steps:
1) Create your DIV tag. For example (this uses an hourglass image that you can substitute with your own image file in place of hourglass.gif):

<div id="waitmessage" style="Z-INDEX:-1; LEFT:0px; VISIBILITY:hidden; WIDTH:300px; POSITION:absolute; TOP:200px; HEIGHT:100px">
<table border="2" style="BORDER-COLLAPSE: collapse" width="300" height="100" cellspacing="1"
bgcolor="#ffffff" bordercolor="#000000">
<tr>
<td align="right" bordercolor="#ffffff">
<asp:Image id="imgHourglass" runat="server" ImageUrl="../Controls/WaitMessage/images/hourglass.gif"></asp:Image>
</td>
<td align="center" class="bblrg" width="239">Your submission<br>
is being processed.<br>
<br>
Please wait a moment...</td>
</tr>
</table>
</div>

2) Add code to your the ASP.NET page's PreRender function:

private void Feedback_PreRender(object sender, System.EventArgs e)
{

// this requires a DIV tag called "waitmessage" in order to work
System.Web.UI.Page p = this;
p.RegisterOnSubmitStatement("OnSubmit",
"javascript:showWaitMessage();");
p.RegisterClientScriptBlock("showWaitMessage",
"<script>\n" +
"function showWaitMessage()\n" +
"{\n" +
"var IW = window.innerWidth ? window.innerWidth : document.body.clientWidth;\n" +
"var IH = self.outerheight;\n" +
"self.scrollTo(0, 0);\n" +
"if( document.all )\n" +
"{\n" +
" document.all.waitmessage.style.left=(IW-300)/2;\n" +
" //document.all.waitmessage.style.top=IH-100;//(IH-100)/2;\n" +
" document.all.waitmessage.style.visibility=\"visible\";\n" +
" document.all.waitmessage.style.zIndex=99;\n" +
"}\n" +
"else if( document.getElementById )\n" +
"{\n" +
" document.getElementById(\"waitmessage\").style.left=(IW-300)/2;\n" +
" document.getElementById(\"waitmessage\").style.visibility=\"visible\";\n" +
" document.getElementById(\"waitmessage\").style.zIndex=99;\n" +
"}\n" +
"else\n" +
"{\n" +
" document.waitmessage.left=(IW-300)/2;\n" +
" document.waitmessage.visibility=\"show\";\n" +
" document.waitmessage.zIndex=99;\n" +
"}\n" +
"}\n" +
"</script>\n");

}




Credits to its author!!

Friday, October 26, 2007

Well, I am thinkng what would be the ideal topic for my first blog? Three options, it could be some memorable experienc from the past, the realities of the present or something that might happen in near future. Since past is past and I don't intend to peep into the uncertainties of the future, let me write something about the present!



Presently, I am in Vienna, on an official assignment. I will complete 8 months of my stay at the end of this month. These 8 months have been special in every respect and will always be something that I would cherish for the rest of my life. Hope its only the beginning! ;).



A short picture of the city of Vienna (Wien, in German) - Capital of Austria, a city famous for its Music, theatres, operas, museums, old Architectural style buildings. Its also Austria's main centre of education and home to many universities. Its also a destination for higher education for people from around the globe. It has an excellent network of public transportation, one of the best in the world. Its well connected to the other European cities through road, railways and ofcourse, by airways. Thats it about the city! :-)



It was my first overseas trip. I was excited about my first flight journey! There were a hundred thoughts flashing through my mind. Out of them, primarily it was the concern about -food, weather and work! Luckily for me, I reached here almost during the end of winter, which meant I was not going to face the quick transition from the hot climate back in India to the cold winter here! Myself being a vegetarian, food was another factor, since in European cities vegetarians are still a rare species. But another good thing is that most houses even for rent, comes furnished, to the extent that you have washing machine, cooking gas, utensils, cots! So, once you have some elementary cookings skills you can survive pretty much without depending on outside food. And believe me, initial few months, you always tend to eat less of outside food. Ask me why? A pizza would cost you 2.5 Euros, which if you convert to INR is a whopping Rs 135/-. Rs 135/- for a pizza? You must be kidding! :P.



And finally to the work part, I was in for a surprise here! Having worked in congested cubicles, with your PM walking past you every other minute trying to invade into your "privacy" (:P), my new work place was something out of the ordinary. I had a separate room with my name board stuck outside and the room in which one worked is called his "office". So it would be technically correct to tell some one, "hey buddy, why don't you come to my office for a chat?" ;) My login account was already created which I used to login to my system. Opened the browser, typed in http://www.gmail.com/, wow it works! then tried http://www.orkut.com/, wow that too works! What more could I have asked for? A separate office room with chairs and tables and a system with "uncensored" internet access! :P. I was beginning to feel at home already! :P

Having felt at home with weather,food and work, it was now time to find a real "home" for me to stay. One of my colleagues offered to help and we together went in to the office Cafeteria, where I happened to meet Mr.Jose Kizhakkekkara, who, I later realised is a well known personality among Malayalees in Vienna and was instrumental in providing job opportunities for a sizeable number of Indians, esp malayalees in Vienna. With his help, I managed to get a house to stay, along with my present room mate Mr. Linto, who too works in the same place.

Linto is a very pleasing personality himself, and he maintains a good social relationship with everyone he meets. So him being my roommate, gave me the opportunity to meet lot of other Indians, esp Malayalees. I was amazed to see the number of Malayalees already working there on a regular job. With time, my friends circle increased. I had the distinction of being the only Hindu among my mallu friends and me being from a kerala iyer family, was re-christened by the name "pattar" by my loving friends. :-)

Out of the many acquaintances and friends I made, a few remain very close to my heart. Tomi chettan and Jessie chechy stand apart in that list. They are more like my local guardians and truly wonderful and amazing people I have ever met! My room mate Linto is a very dear friend. We discuss almost all the things under the sky. I don't get into the other names for the fear of missing out some one! ;)

One common thing you will find among my friends, is that , they all dream and believe in "living life fullest" Having set the stage, I will write about my wonderful experiences with these wonderful people in a wonderful city, in the coming posts! :-)