Sử dụng template Silverlight Business Application là cách nhanh nhất để tạo một ứng dụng Silverlight n-tier có hỗ trợ đầy đủ các tác vụ thêm, xóa, sửa, đăng nhập với RIA Services. Trong bài viết này, mình sẽ giới thiệu sơ lược về template Silverlight Business Application. Để template này xuất hiện trong cửa sổ “New Project” bạn phải cài WCF RIA Services. Bạn có thể tải về và cài đặt tại đây. Sau khi cài đặt WCF RIA Services, ngoài template “Silverlight Business Application” được thêm vào còn có template “WCF RIA Services Class Library” | CHAPTER 1 INTRODUCING SILVERLIGHT img src http fwlink LinkId 108181 alt Get Microsoft Silverlight style border-style none a object iframe id _sl_historyFrame style visibility hidden height 0px width 0px border 0px iframe div body html The key detail is the div element that represents the Silverlight content region. It contains an object element that loads the Silverlight plug-in. The object element includes four key attributes. You won t change the data and type attributes they indicate that the object element represents a Silverlight content region using version 2 or later. However you may want to modify the height and width attributes which determine the dimensions of the Silverlight content region as described next. Note Be cautious about changing seemingly trivial details in the HTML test page. Some minor quirks are required to ensure compatibility with certain browsers. For example the comma at the end of the data attribute in the object element ensures Firefox support. The invisible iframe at the bottom of the Silverlight div allows navigation to work with Safari. As a general guideline the only test page content you should change are the width and height settings the list of parameters and the alternate content. CHANGING THE TEST PAGE If you re using an website the test page is generated once when the website is first created. As a result you can modify the HTML page without worrying that your changes will be overwritten. If you re using a stand-alone project without an website Visual Studio generates the test page each time you run the project. As a result any changes you make to it will be discarded. If you want to customize the test page the easiest solution is to create a new test page for your project. Here s how 1. Run your project at least once to create the test page. 2. Click the Show All Files icon at the top of the Solution Explorer. 3. Expand the Bin Debug folder in the Solution Explorer. 4. Find the .