Asp.net ajax program design notebook 3 - ScriptManager attributes of EnablePageMethods
Related Tags:
ScriptManager the EnablePageMethods attribute set javascript direct client services-called static WebMethod
EnablePageMethods.aspx
<script Type="text/javascript">
Var txtName;
Var lblMsg;
Function pageLoad () (
TxtName = new Sys.Preview.UI.TextBox ($ get ( 'txtName'));
LblMsg = new Sys.Preview.UI.Label ($ get ( 'lblMsg'));
)
Function sayHello () (
PageMethods.SayHello (txtName.get_text (), cb_SayHello);
)
Function cb_SayHello (result) (
LblMsg.set_text (result);
)
</ Script>
<form Id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True">
<Scripts>
<asp:ScriptReference Name="PreviewScript.js" Assembly="Microsoft.Web.Preview" />
</ Scripts>
</ Asp: ScriptManager>
<input Type="text" id="txtName" />
<input Type="button" value="invoke" onclick="sayHello()" />
<div Id="lblMsg"> </ div>
</ Div>
</ Form>
EnablePageMethods.aspx.cs
[System.Web.Services.WebMethod]
Public static String SayHello (string name)
(
Return "welcome to site" + name;
)
- XHTML
- AS MC control with the tilt attributes
- CSS Attributes
- [XHTML Tutorial] to XHTML standards (4) (XHTML Syntax)
- Alt attributes and attribute title
- [XHTML Tutorial] to XHTML standards (7) (XHTML Modularization)
- Common HTML tags and attributes
- [XHTML Tutorial] to XHTML standards (5) (XHTML DTD)
- [XHTML Tutorial] to XHTML standards (1) (Introduction to XHTML)
- HTML font marker and attributes
- HTML forms marked and attributes
- [XHTML Tutorial] to XHTML standards (6) (XHTML HOWTO)
- Form a whole set of attributes
- HTML tags and attributes of the Semantic
- Segmentation Attributes window settings
- Using CSS attributes of the Border
- XHtml rules - Html into XHtml
- HTML tag attributes of the image
- IFRAME attributes reference manual
- [XHTML Tutorial] XHTML Guide - to XHTML standards




