1 / 16
文档名称:

AJAX脚本注册使用方法.docx

格式:docx   大小:28KB   页数:16页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

AJAX脚本注册使用方法.docx

上传人:cjl201702 2021/10/16 文件大小:28 KB

下载得到文件列表

AJAX脚本注册使用方法.docx

相关文档

文档介绍

文档介绍:1 / 10
AJAX脚本注册的使用方法
e)
protected void Buttonl_Click( object sender, EventArgs
ClientScriptManager cs = this . ClientScript;
2 / 10
cs. RegisterArrayDeclaratio n(
"Hello” , 〃1, 2,
V
this .GetType()
true )1个和程露强因需融而宏PtBl。 ,
沙 cs. RegisterClientScriptResource, cs. RegisterExpandoAttribute( this
);
〃HelloWorld〃 , “function helloWorld() {alert (1) ;}〃
"HelloWorld",
"HelloWorld. js,z );个人收集整理勿做商业用途
., “Hello" , "World");个人收集整理 勿做商业用途
2 / 10
2 / 10
“world");
( "hello”, cs. RegisterOnSubmitStatement( this . GetType (), “HelloWorld" , "return window, confirm(' Do you really
want to submit the form?')”);个人收集整理 勿做商业用途
cs. RegisterStartupScript ( this . GetType (), “HelloWorld” , z,<script>alert (' The page has
loaded!')〈/script>”);个人收集整理 勿做商业用途
ClientScriptManager. RegisterOnSubmitStatement 方法
public void RegisterOnSubmitStatement (
Type type,
string key,
string script
RegisterOnSubmitStatement添加一个脚本,该脚本在页面提交前执行并提供取消提交的机 会。个 人收集整理勿做商业用途
<%@ Page Language=〃C#〃%〉
<script runat32^server/z>
public void Page_Load(Object sender, EventArgs e) {
个人收集整理勿做商业川
个人收集整理勿做商业用途
个人收集整理勿做商
个人收集整理勿做商业用途
// Define the name and type of the client script on the page. 途
String csname 二 〃OnSubmitScript〃;
Type cstype = this .GetType();
2 / 10
// Get a ClientScriptManager reference from the Page class. ClientScriptManager cs 二 ;
// Check to see if the OnSubmit statement is already registered.
业用途 if(! cs. IsOnSubmitStatementRegistered (cstype, csname))
6 / 10
7/10
String cstext = z,docume nt. writeC Text from On Submit stateme nt');〃; 个人收集整理勿 做商业用途
cs. Register On SubmitStateme nt (csty pe, esn ame, cstext); 个人收集整理勿做商业用途
)
</scri pt>
<head>
<title>Clie ntScri ptMa nager Exa mp lev/title>
</head>
<body>
<form id二〃Fonnl〃
run at= server /
vinput typ e二〃submit” value二〃Submit”〉
</form>
</body>
</html>
方法
方法 使用数组名称和数组值向 P