Friday, February 6, 2009

How To access session variable in javascript

<script language="JavaScript">

var MySessionvalue = <% = Session("key") %>;
...
</script>

No way possible without creating a PostBack or using AJAX. Here's an example using a PostBack:
aspx file:
<script type="text/javascript">
<!--
function setSessionVariable(valueToSetTo)
{
 __doPostBack('SetSessionVariable', valueToSetTo);
}
// -->
</script>
aspx.cs file:
private void Page_Load(object sender, System.EventArgs e)
{
 // Insure that the __doPostBack() JavaScript method is created...
 this.GetPostBackEventReference(this, string.Empty);
 if ( this.IsPostBack )
 {
  string eventTarget = (this.Request["__EVENTTARGET"] == null) ? string.Empty : this.Request["__EVENTTARGET"];
  string eventArgument = (this.Request["__EVENTARGUMENT"] == null) ? string.Empty : this.Request["__EVENTARGUMENT"];
  if ( eventTarget == "SetSessionVariable" )
  {
   Session["someSessionKey"] = eventArgument;
  }
 }
}


<script type="text/javascript" language="javascript">

var sessionValue = '<%= Session["SesValue"] %>';
alert(sessionValue);

</script>
 Put This Script In Your Page Inline

How To install font in Windows

Install a font, follow these steps:
4000 Fonts

  1. Click Start, and then click Run.
  2. Type the following command, and then click OK:
    %windir%\fonts
  3. On the File menu, click Install New Font.
  4. In the Drives box, click the drive that contains the font that you want to add.

    Note The floppy disk drive is typically drive A or drive B. The CD drive is typically drive D.
  5. In the Folders box, click the folder that contains the font that you want to add, and then click OK.
  6. In the List of fonts box, click the font that you want to add. To select more than one font at a time, press and hold the CTRL key while you select each font.
  7. Click to select the Copy Fonts To Fonts Folder check box. The new font is saved in the Windows\Fonts folder.
  8. Click OK.
Note Windows supports TrueType fonts or fonts that are designed especially for Windows which can be purchased separately. Some programs also include special fonts that are installed as part of the program installation. Additionally, TrueType or special Windows fonts are frequently included with printers. Follow the directions that are included with these products to install these fonts.

How to learn a foreign language fast


The Million Dollar Question: How Do I Learn a Foreign Language Fast?

There are many reasons someone may want to learn language fast. Those reasons could include: economic reasons, employment, travel, personal growth and many others. The reality is that learning a foreign language fast is simply just not that easy.
It is widely known that the fastest way to learn a foreign language is through immersion. Immersion is a process where you place yourself in the culture and nation where the language is readily spoken and force yourself to communicate with the people in their natural language of choice. A great example of this is the Hebrew Immersion program in Leonia, N.J., children at a very young age are placed in a situation that makes them speak Hebrew on a continual basis. Recent research has shown that studying a foreign language early boosts a child's brainpower, vocabulary and self-esteem (Wiener 2002). This research clearly demonstrates that an individual can learn a foreign language fast through immersion.
The problem with immersion techniques are many fold. First, there are simply not many programs around and those that do exist are for children. Second, in today's world not many have the time to travel to a foreign land and begin to learn the language through immersion. Finally, economically an immersion program is very expensive to undertake.

Four ways to learn a foreign language fast

The fastest ways to learn a foreign language

The Four Ways to Learn Language
·              1. Language Exchange Programs
·              2. Distance Learning
·              3. Language Courses
·              4. Language Software and Self Teaching
 
Language Exchange Programs
Language Exchange programs are where a person begins to communicate with someone from a different country on a frequent basis. In the old days this used to be called getting a pen pal. Language exchanges help to learn a foreign language fast. The language exchanges force you to begin communicating with someone who speaks a foreign language on a regular basis. The exchange programs today are much easier in past because of the invention of the internet. The internet allows a person to communicate through email and has many tools that help in the conversion of the language. Enrolling in a language exchange program will greatly increase the speed at which you learn a language and you will create a friend or colleague in a foreign land.
 
Language Correspondence Programs
Distance learning is now a staple of most higher education learning institutions. Distance education or online learning allows a user to enroll in a college course and learn at their convenience. The great component of distance learning is that is very comprehensive, often times can learn at your own pace and the quality standards are maintained at a high level.
The problem with distance learning is that is can be very costly and because of the depth of coverage may not cover too much breadth for the cost of the program. Correspondence programs are a great way to learn for those who have time and flexibility to complete the courses. However, college courses and correspondence programs usually do not help us to learn a foreign language fast.
 
Language Software and Self Teaching
Self teaching through reading materials and software is the most popular way to learn a foreign language fast. The popular programs like Rosetta Stone, Rocket Spanish and others make claims that an individual can learn a language in as little as 3 - 6 months. Most of the higher quality software programs on the market today use a variety of multimedia to help the student learn the foreign language fast. It is very important the software features reading, writing, listening and speaking as a feature of the program.
The top end computer programs can cost upwards of $300 - $500. Purchasing two or three language programs would equate to an expense of a $1000 for the top end software. While these programs are expensive they are a fraction of the cost of taking a college course or correspondence course. It is important to remember that using any computer program requires self discipline and patience to get the full benefits of the program.
If you want to learn a foreign language fast there is no easy solution. A combination of language exchange programs coupled with a good language software program like Rosetta Stone or Rocket Spanish will greatly accelerate a uses ability to learn a foreign language fast.