Archive for November, 2008

Create context shortcut for Visual Studio msbuild

I have searched in the internet to find an easy way to rebuild my visual studio solution without open it.  Then I find there is a way to update the registry to provide a context shortcut to run msbuild command by right-click on .sln file from David Mohundro’s website.

You can create a msbuild.reg file by copying the below script (which this is for .net framework 3.5), and run this reg file.

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\shell\msbuild]
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\shell\msbuild\command]
@=”\”C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5\\MSBuild.exe\” /target:Rebuild \”%1\”"

0811msbuild_shortcut

November 17, 2008 at 11:11 pm Leave a comment

Javascript: onchange problem

I have wrote some javascript to try synchronize the value from textBox1 to textBox2, and then added to the textBox1 in cs file like this:

String SyncValueScript = "document.getElementById('" + textBox2Control.ClientID +
"').value = this.value;";
textBox1Control.Attributes.Add("onchange", SyncValueScript);

However I found that there is a situation that onchange will not be fired, even the value of textBox1 is changed. Below is the step to reproduce this situation:

  1. Open two IE windows.
  2. Copy some values in the clipboard and paste on textBox1 in IE window 1.
  3. Then click on IE window 2.
  4. Go back to the IE window 1 by click on controls other than textBox 1.
  5. you will find that the value of textBox1 is not synced to textBox2.

Solution: there is a very easy fix for this problem, just use “onblur” event instead of “onchange”.

November 4, 2008 at 1:23 am Leave a comment


Recent Posts

Categories


Follow

Get every new post delivered to your Inbox.