tailieunhanh - ASP.NET 4 Unleased - p 33

Chu kỳ, ApproxError, ForecastError cho phép bạn tùy chỉnh như thế nào phân tích được thực hiện. Bạn có thể tìm thấy những bộ hoàn chỉnh các thông số cho mỗi công thức trên trang web của MSDN. | 294 CHAPTER 6 Designing Websites with Themes For example the page in Listing enables a user to select a favorite skin for a GridView control. The GridView control displays a list of movies see Figure . FIGURE Applying a Skin programmatically. LISTING @ Page Language C Theme DynamicSkin DOCTYPE html PUBLIC - W3C DTD XHTML EN http TR xhtml11 DTD script runat server protected void Page_PreInit object if Request skin null switch Request skin case professional break case colorful sender EventArgs e Professional Colorful From the Library of Wow eBook Applying Themes Dynamically 295 break script html xmlns http 1999 xhtml head runat server title Show Dynamic Skin title head body form id form1 runat server div asp GridView id grdMovies DataSourceID srcMovies Runat server asp SqlDataSource id srcMovies ConnectionString ConnectionStrings Movies SelectCommand SELECT Id Title Director FROM Movies Runat server hr 6 a href skin professional Professional a nbsp nbsp a href skin colorful Colorful a div form body html A hyperlink is used to select a particular Skin. The Skin is applied to the GridView in the Prelnit event when a particular value is assigned to the GridView control s SkinlD property. Of course I don t recommend doing this. It makes more sense to use a CSS and modify a control s CssClass property. This alternative approach is demonstrated by the page in Listing . From the Library of Wow eBook 296 CHAPTER 6 Designing Websites with Themes LISTING @ Page Language C Theme DynamicSkin DOCTYPE html PUBLIC - W3C DTD XHTML EN http TR xhtml11 DTD script runat server protected void btnSubmit_Click object sender EventArgs e script html xmlns http 1999 xhtml head id Head1 runat server title Show Dynamic CSS title .