Wednesday, July 1, 2009

Rendering HTML tags in blog

To render HTML tags in blog we need to use

to render '&' we have to use &
to render '<' we have to use &lt;
to render '>' we have to use &gt;

Similar all the other HTML tags can be displayed in the blogs.

Tuesday, June 30, 2009

InnerHTML vs InnerText ASP.Net

InnerHTML renders the html.
InnerText does not render html. It just assigns the value to the specified node.

Sample:

string myContent = "<p>Some HTML markup 3 &lt; 5 text </p>";
myDiv1.InnerText = myContent;
myDiv2.InnerHtml = myContent;

myDiv1 will be rendered as "<p>Some HTML markup 3 &lt; 5 text </p>"
myDiv2 will be rendered as "Some HTML markup 3 < 5 text" in a para.

Wednesday, June 24, 2009

Javascript Multiplication Error

When we try to multiply a decimal value with another decimal number or integer, javascript does not seem to handle this well.

for eg: 38.23 * 100 returns 3822.999999999995 instead of 3823.00

To solve this issue we need to use Math.round function

Solution:
Multiply the number by 1000, round it and then divide by 1000. This will give the expected result.

Math.round(1000 * 38.23 * 100) / 1000

Hope this solves the multiplication issue present in javascript and also your time.

Sunday, April 26, 2009

Getting Ration Card in Bangalore

Hello All,

  I am writing  my experience of getting ration card in Bangalore. 

We require 2 documents
1.   NOC from home town saying "I dont have a ration card @ my home town" or saying "Name has been deleted from the ration card @ home town".
2.  Address Proof of the current residencial address (House Rent Agreement etc.)

With these 2 documents, we need to go to the Food and Civil Supplies Department. As I was staying in Domlur area, I had to go to Food and Civil Supplies Department located @ St. Johns Road.

I filled a form, which was totally in Kannada, and then submitted the document along with the above 2 documents along with Rs. 10/-. It would be more helpful if we take a guy who can read kannada.

Then I was asked to come after 1 month time to collect the ration card.

When I went after 1 month to the Department, I collected my ration card. My photo was taken and my ration card got printed in about 15 mins time. I had to give Rs. 45/- as lamination charges to the guy who printed the ration card and had it laminated.

So, if we have the NOC then getting the ration card is pretty simple.

Over all I would say it was a pleasant experience..even though I had some rough time finding the Department in St.Johns Road.

Hope the above experience would be useful to you all.

hem@nth

Tuesday, March 17, 2009

Power Points Switches in 3rd AC Compartments Trains

Hello All,

I would like to share my experience while travelling to Kharagpur from Bangalore on Feb 20, 2009 in Yeswantpur Howrah Express.

I had taken a 3rd AC ticket, and was wondering if there would be Power Points in the individual cabins or not. I tried reading lot of blogs, forums but could not get any info.

While going from Bangalore to Kharagpur, our compartment had Power points for all the cabins (8 seats group). While the adjacent 3rd AC coach had power points in every alternate cabin.

This is mainly intended for charging of mobile phones, though even laptops can be charged with this. If the circuit breaks because of over load in the compartment, ask the attender to pull the switch again so that all power points are funcional again.

However while returning my coach (3rd AC) has power points at every alternative cabin.

The railways has really improved a lot over the last couple of years.

If you are planning to travel for a long distance with the airfare rates going so high, travelling in train is not a bad option at all.

Cheers

Friday, January 30, 2009

Javascript ASP.Net

Always use ID instead of name to refer to controls in the ASP/ASP.Net page. If we use name, then the control cannot be idetified in javascript. 

If the control has only name and ID is not associated with the control, then add the ID to the control and then use this ID to identify the control in javascript

paying road tax in RTO Bangalore

I am sharing one more experience of my friend who paid his road tax directly with out any agents

He had all the documents required. He had been to the RTO office for 3-4 continous SATURDAY's to find out that 2nd SAT is holiday for RTO people. 

He paid the road tax directly along with change of address.  He brought his NOC from Hyderbad for his bike.

He was made to wait for 2 hours near his bike for the inspection, and atlast he paid his road tax as well as was able to get a change of address.