August 10, 2004

Some clilent side javascript code of my newly developed HR Quiz Bank refused to work last Saturday afternoon during the last minute before UAT while it ran perfectly on my own machine. It took me about one hour to realize that it was all because of a compatility issue between Microsoft .Net framework 1.1 and 1.0, the one installed on my own machine is 1.0.3705 while the UAT server is equipped with 1.1. Before .Net framework 1.1, when you put a checkbox into a template column of DataGrid, Microsoft will enclose it with a span element, however, this span element is removed on 1.1 platform.


AutoPostBack="False" onclick="javascript:positionChanged(this)">




athos
.net framework 1.0.3705.0 与 1.1.4322 的小小差异

如果aspx文件中写:



那么,.net framework 1.1.4322解析作:



而1.0.3705.0则作:



这个结果不能执行javascript。

解决方法是改在code behind里赋值:

CheckBox1.Attributes.Add("onClick", "prompt('hi', 'onclick');");

No comments: