Master page and Theme ASP.NET with VB.NET

959 views
743 views

Published on

ASP.NET

Published in: Engineering, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
959
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Master page and Theme ASP.NET with VB.NET

  1. 1. Shyam N. Chawda 07874391191 www.shyamsir.com
  2. 2. .master .aspx Shyam N. Chawda 9374928879
  3. 3. Shyam N. Chawda 9374928879 A page that defines the layout for a set of pages. A master page can contain static text and controls that should appear on all pages. Master pages are merged at run time with content pages that define page- specific content.
  4. 4. A Web page that is configured to be merged with a master page to create a complete page. <%@ Page Language="VB" MasterPageFile="Master1.master" Title="Content Page" %> Shyam N. Chawda 9374928879
  5. 5. Shyam N. Chawda 9374928879 Shyam N. Chawda 9374928879
  6. 6. Shyam N. Chawda 9374928879
  7. 7. Centralize the common Easy to create one set of controls and code and apply the results to a set of pages. Shyam N. Chawda 9374928879
  8. 8. Problem
  9. 9. Shyam N. Chawda 9374928879 Create masterpage With label give it proper name. Create .aspx page take one button To refer master page u can write Master.Page.Title = “abc”
  10. 10. Change the master page’s control value Dim txt As TextBox txt = Me.Master.FindControl("txtName") txt.Text = txtFname.Text Shyam N. Chawda 9374928879
  11. 11. Shyam N. Chawda 9374928879
  12. 12. Large site might contain an overall master page that defines the look of the site. Example : College Faculty Student Shyam N. Chawda 9374928879
  13. 13. Page_PreInit Me.MasterPageFile = "MainMasterpage.master" Shyam N. Chawda 9374928879
  14. 14. A theme is a collection of property settings that allow you to define the look of pages and controls. Shyam N. Chawda 9374928879
  15. 15. Themes are made up of a set of elements: Skins Cascading style sheets (CSS), images, and other resources. At a minimum, a theme will contain skins. Shyam N. Chawda 9374928879
  16. 16. A skin file has the file name extension .skin and contains property settings for individual controls such as Button, Label, TextBox, or Calendar controls. Shyam N. Chawda 9374928879
  17. 17. <%@ Page Theme="ThemeName" %> Shyam N. Chawda 9374928879
  18. 18. <configuration> <system.web> <pages theme="ThemeName" /> </system.web> </configuration> Shyam N. Chawda 9374928879
  19. 19. A default skin automatically applies to all controls of the same type when a theme is applied to a page. A named skin is a control skin with a SkinID property set. Named skins do not automatically apply to controls by type. Shyam N. Chawda 9374928879
  20. 20. Shyam N. Chawda 9374928879 EnableTheming SkinId
  21. 21. Shyam N. Chawda 9374928879 In the skin file, u can define only the styles associated with server controls. What about HTML tags and HTML controls? CSS
  22. 22. Step 1: Create App_theme folder Step 2: Add new CSS Step 3: Write down logic Shyam N. Chawda 9374928879
  23. 23. Step 4: Go to .aspx page Step 5: Apply <%@ Page StyleSheetTheme="ThemeName" %> Shyam N. Chawda 9374928879
  24. 24. <configuration> <system.web> <pages StyleSheetTheme="Themename" /> </system.web> </configuration> <%@ Page StyleSheetTheme="ThemeName" %>
  25. 25. Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit Page.Theme = Request.QueryString("th") End Sub
  26. 26. Types of Theme: Page Global Page for single page , individual for all the pages Global applied to all the websites on a web server. Shyam N. Chawda 9374928879
  27. 27. Shyam N. Chawda 07874391191 Thanks www.shyamsir.com

×