Đang chuẩn bị liên kết để tải về tài liệu:
Professional ASP.NET 3.5 in C# and Visual Basic Part 15

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Professional ASP.NET 3.5 in C# and Visual Basic Part 15. Building on the revolutionary ASP.NET 2.0 release, ASP.NET 3.5 adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in ASP.NET 2.0 now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 2 ASP.NET Server Controls and Client-Side Scripts End Function End Class C code-behind using System using System.Data using System.Configuration using System.Collections using System.Web using System.Web.Security using System.Web.UI using System.Web.UI.WebControls using System.Web.UI.WebControls.WebParts using System.Web.UI.HtmlControls public partial class RandomNumber System.Web.UI.Page System.Web.UI.ICallbackEventHandler private string _callbackResult null protected void Page_Load object sender EventArgs e string cbReference Page.ClientScript.GetCallbackEventReference this arg GetRandomNumberFromServer context string cbScript function UseCallback arg context cbReference Page.ClientScript.RegisterClientScriptBlock this.GetType UseCallback cbScript true public void RaiseCallbackEvent string eventArg Random rnd new Random _callbackResult rnd.Next .ToString public string GetCallbackResult return _callbackResult When this page is built and run in the browser you get the results shown in Figure 2-16. Clicking the button on the page invokes the client callback capabilities of the page and the page then makes an asynchronous request to the code behind of the same page. After getting a response from this part of the page the client script takes the retrieved value and places it inside the text box all without doing a page refresh Now take a look at the .aspx page which simply contains an HTML button control and a TextBox server control. Notice that a standard HTML button control is used because a typical asp button control 93 Chapter 2 ASP.NET Server Controls and Client-Side Scripts does not work here. No worries. When you work with the HTML button control just be sure to include an onclick event to point to the JavaScript function that initiates this entire process input id Button1 type button value Get Random Number onclick GetNumber é Callback Page - Windows Internet Explorer j I http localhost49267 ServerControls RandomNumber.as 4 X Goooie p J ijj Page Tools

TÀI LIỆU LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.