Category Archives: Web Development

jQuery比较两张图片

这个有关日本地震的新闻页做得很不错:日本地震前后卫星图像对比 http://news.ifeng.com/world/special/ribendizhen/duibi.shtml&nbsp; 分析整理一下其实现机制。 整理后的代码分为3个部分:1. CSS 用于设置包含before,after图片的 两个div的样式 <style media=”screen” type=”text/css”>      #beforeafter .section      {          margin-top: 2em;          position: relative;      }      #beforeafter .section p.source      {          position: absolute;          right: 0;          top: 0.5em;          color: #999;          font-size: 7pt;      }      .beforeafter      {          position: relative;          overflow: hidden;      }      … Continue reading

Posted in Web Development | Leave a comment

File downloading fails when using SSL

There is a file downloading function as:  protected void Button1_Click(object sender, EventArgs e){          string path= @”c:\windows\notepad.exe”;          FileInfo fileInfo = new FileInfo(path);           if (fileInfo.Exists)          {              Response.Clear();              Response.ContentType = “application/octet-stream“;               Response.AddHeader(“Content-Disposition”, “attachment; filename=” + fileInfo.Name);              Response.AddHeader(“Content-Length”, fileInfo.Length.ToString());              Response.WriteFile(fileInfo.FullName);              Response.Flush();          } … Continue reading

Posted in Web Development | Leave a comment

笔记: 用powershell进行web测试

Request/Response Testing with Windows PowerShellhttp://msdn.microsoft.com/en-us/magazine/cc507642.aspx 1.用WebClient获取ViewState和EventValidation 2.用WebRequest模拟button click,发送web request. 注意对radio box 和 buttong的模拟    $postData = ‘TextBox1=5&TextBox2=3&Operation=RadioButton1&Button1=clicked’        The fourth name-value pair, Button1=clicked, is somewhat misleading. I need to supply a value for Button1 to simulate that it is being clicked, … Continue reading

Posted in Web Development | Leave a comment

笔记:用jQuery进行UI Testing

Web Application UI Testing with jQueryhttp://msdn.microsoft.com/en-us/magazine/gg490354.aspx使用 JavaScript 实现 Web 应用程序请求-响应测试http://msdn.microsoft.com/zh-cn/magazine/ee335793.aspx 1 . Test harness Test harness是一个UITestHarnes.htm html页面,在页面中使用frameset,左面的fame是包含test逻辑的html页面,右面的fame包含要测试的aspx页面。 2.  Test Logic Page 测试页面用jQuery在要测试的页面中获取控件,并检查结果是否正确 function clickCalculate() {   var btn1 = $(parent.rightFrame.document).find(‘#Button1’);   if (btn1 == null || btn1.val() == undefined)         throw “Did … Continue reading

Posted in Web Development | Leave a comment

Fixing the issue “could not load dojox.grid._data.model” when working with dojo 1.5

I think there were lots of people studying dojo with the famous book “Mastering Dojo” and encountering errors as I did. In section “Researching Cigars Using JSONP” of that book , I got following sample code for data grid operation … Continue reading

Posted in Web Development | Leave a comment

How to Fix “Failed to access IIS metabase”

Maybe you will see following error message when you run your asp.net application on a machine on which you installed .NET Framework before IIS:”System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase. The process account used to run ASP.NET must have read access … Continue reading

Posted in Web Development | Leave a comment

Debug Silverlight with Firefox

http://timheuer.com/blog/archive/2010/08/16/enable-silverlight-debugging-in-firefox-visual-studio.aspx Here’s how to ensure the VS debugger attaches to the Silverlight app for debugging: In Firefox address bar type about:config Read the warning, choose your preference to always remind you or not and accept In the search bar of … Continue reading

Posted in Web Development | Leave a comment

Bing Map Silverlight 实践

Bing Maps地图引擎开放了Silverlight和Ajax两种客户端API,ASP.NET MVC的著名例程NerdDinner(http://www.nerddinner.com/)中就用到了Bing Maps的Ajax版,MS还推出了Bing Maps的Silverlight控件。见Getting Started Using the Silverlight Map Control(http://msdn.microsoft.com/en-us/library/ee681890.aspx)。以下是我对Bing Maps的Silverlight开发的一些尝试和笔记。 准备活动:1. 下载Bing Maps Silverlight控件http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=beb29d27-6f0c-494f-b028-1e0e3187e830 2. 安装Bing Maps Silverlight控件,到https://www.bingmapsportal.com生成Bing Maps帐号以及开发要用到的Bing Maps Key。一个MSN帐号最多可以申请5个Key。详情见Bing Maps Silverlight Control SDK 帮助文件中“Accessing the Control Using a Bing Maps Key”一节。  3. 生成Silverlight Application工程,引用C:\Program Files\Bing Maps … Continue reading

Posted in Web Development | Leave a comment

Function fadeOut in jquery-1.4.1-vsdoc.js does not work in Firefox 3.6.6

In jquery.1.4.1.js, function fadeOut comes with following code: // Generate shortcuts for custom animationsjQuery.each({    slideDown: genFx("show", 1),    slideUp: genFx("hide", 1),    slideToggle: genFx("toggle", 1),    fadeIn: { opacity: "show" },    fadeOut: { opacity: "hide" }}, function( name, props ) {    jQuery.fn[ name … Continue reading

Posted in Web Development | Leave a comment

Sliverlight 3.0 程序的AG_E_PARSER_UNKNOWN_TYPE异常

把一个Sliverlight2.0程序升级成到3.0,运行时出现AG_E_PARSER_UNKNOWN_TYPE异常。程序崩溃在某个页面的InitializeComponent()方法中的System.Windows.Application.LoadComponent(this, new Uri(<XXX.xaml>) 原因:该页面用到了StaticResource binding,VS自动生成的resource class的构造函数为internal,需要把它改成public。

Posted in Web Development | Leave a comment