通过以上的学习,我们可以简单的了解屏聊系统的整个开发思路及在开发中所出现的重点难点。读者可以试着去按照功能思路去实际操作一下,下面懒羊把使用VS2005操作的具体步骤附上,但我还是希望读者能够先看一下前面的内容再来看下面的内容:
1、打开VS2005—> 新建—> 网站—> ASP.Net网站;
2、为了方便以后移植,我们为项目添加用户控件。右击项目文件—> 添加新项;
3、拖动ScriptManage控件到页面,并为Scripts属性添加anchormain.js,如下图:
图四 为Scripts属性添加anchormain.js
Anchormain.js为屏聊系统界面客户端代码,其中包括页面位置显示、页面加载、关闭时所触发的事件功能,代码如下,详细可以参照《Ajax开发页面聊天系统》一文。
// JScript 文件
(){alert(
).offsetHeight,10);
divWidth = parseInt(document.getElementById("eMsg").offsetWidth,10);
document.getElementById("eMsg").style.top =(document.documentElement.clientHeight - divHeight + parseInt(document.documentElement.scrollTop,10))+"px";
document.getElementById("eMsg").style.left = (parseInt(document.documentElement.scrollLeft,10) + document.documentElement.clientWidth - divWidth)+"px";
}
catch(e){
}
}
{
if(parseInt(document.getElementById("eMsg").style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)));
,1);
}
divTop = (parseInt(document.getElementById("eMsg").style.top,10))+"px";
document.getElementById("eMsg").style.top =( divTop - 1 )+"px";
}
catch(e){
}
}
).style.display=).offsetWidth,10)
).style.top =(parseInt(document.documentElement.scrollTop,10) + docHeight + 10)+"px";// divHeight
,10) ;
).style.display=
).style.display=
).style.display="none";
}
,"")
}
,
}
,
keycode = ,"");
}
}
4.根据屏聊界面拖放UpdatePanel控件,并为UpdatePanel控件设置Triggers和UpdateMode。