展会信息港展会大全

ASP.NET Ajax Library功能简介
来源:互联网   发布日期:2016-01-27 15:29:56   浏览:2588次  

导读:ASP NET Ajax Library中的一些功能,以及和jQuery的整合方式。首先来看ASP NET Ajax Library中Client Controls的使用(底下的范例是水印的TextBox):以下为引用的内容:head titleUntitled Page ti ...

ASP.NET Ajax Library中的一些功能,以及和jQuery的整合方式。首先来看ASP.NET Ajax Library中Client Controls的使用(底下的范例是水印的TextBox):

以下为引用的内容:

<head>

<title>Untitled Page</title>

<style type="text/css">

.wm {

color:Gray

}

</style>

<!--從CDN引用js-->

<script src="http://ajax.microsoft.com/ajax/jquery

/jquery-1.3.2.js" type="text/javascript"></script>

<script src="http://ajax.microsoft.com/ajax/beta/0911

/Start.debug.js" type="text/javascript"></script>

<script src="http://ajax.microsoft.com/ajax/beta/0911

/extended/ExtendedControls.debug.js" type="text/javascript"></script>

<script type="text/javascript">

//建立watermark

Sys.require(Sys.components.watermark, function() {

$("#TextBoxName").watermark("<請輸入您的姓名>", "wm");

});

</script>

以下为引用的内容:

</head>

<body>

<input type="text" id="TextBoxName" size="50" />//實際的TextBox

</body>

<head>

<title>Untitled Page</title>

<style type="text/css">

.wm {

color:Gray

}

</style>

<!--從CDN引用js-->

<script src="http://ajax.microsoft.com/ajax/jquery

/jquery-1.3.2.js" type="text/javascript"></script>

<script src="http://ajax.microsoft.com/ajax/beta/0911

/Start.debug.js" type="text/javascript"></script>

<script src="http://ajax.microsoft.com/ajax/beta/0911/extended

/ExtendedControls.debug.js" type="text/javascript"></script>

<script type="text/javascript">

//建立watermark

Sys.require(Sys.components.watermark, function() {

$("#TextBoxName").watermark("<請輸入您的姓名>", "wm");

});

</script>

</head>

<body>

<input type="text" id="TextBoxName" size="50" />//實際的TextBox

</body>

请注意上面这段脚本是HTML Code, 没有一丁点的ASP.NET Server Code, 单纯只是透过ASP.NET Ajax Library与JavaScript来呈现出水印的TextBox(其中还用到了一点点jQuery语法。回头看前面的HTML与JavaScript Code,这中间有相当多的新技术,包含AJAX Script Loader, ASP.NET Ajax Library中的Client Controls如果您暂时不打算进入Silverlight丰富的世界却又希望能够在HTML页面上呈现出较优质的效果,那即将配合VS2010推出的 ASP.NET Ajax Library是一个不错的选择。由于ASP.NET Ajax Library现在已经是开放原始码的跨浏览器平台JavaScript函式库项目,因此可以想见的,你在ASP, PHP或是其它的Pure Web Application开发技术当中也一样可以使用。

赞助本站

人工智能实验室

相关热词: Library Ajax NET

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港