We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Tuesday, June 30, 2015

ASP.NET Interview Questions on Themes and Skins

What is a "theme" in ASP.NET?
A "theme" is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in a Web application, across an entire Web application, or across all Web applications on a server.

What is the extension of a skin file?
.skin

What are the 2 types of control skins in ASP.NET?
  • Default skins
  • Named skins
What is the difference between Named skins and Default skins?
A default skin automatically applies to all controls of the same type when a theme is applied to a page. A control skin is a default skin if it does not have a SkinID attribute. For example, if you create a default skin for a Calendar control, the control skin applies to all Calendar controls on pages that use the theme. (Default skins are matched exactly by control type, so that a Button control skin applies to all Button controls, but not to LinkButton controls or to controls that derive from the Button object.)

A named skin is a control skin with a SkinID property set. Named skins do not automatically apply to controls by type. Instead, you explicitly apply a named skin to a control by setting the control's SkinID property. Creating named skins allows you to set different skins for different instances of the same control in an application.

What are the 3 levels at which a theme can be applied for a web application?
  •  At the page level - Use the Theme or StyleSheetTheme attribute of the @ Page directive.
  •  At the application level - Can be applied to all pages in an application by setting the <pages> element in the application configuration file.
  • At the web server level - Define the <pages> element in machine.config file. This will apply the theme to all the web applications on that web server.

What is the name of the folder that contains the application themes?

App_Themes

What is a global theme?
A global theme is a theme that you can apply to all the Web sites on a server. Global themes allow you to define an overall look for your domain when you maintain multiple Web sites on the same server.

What is the difference between themes and CSS?
  • Themes can define many properties of a control or page, not just style properties. For example, using themes, you can specify the graphics for a TreeView control, the template layout of a GridView control, and so on.
  • Themes can include graphics.
  • Themes do not cascade the way style sheets do. By default, any property values defined in a theme referenced by a page's Theme property override the property values declaratively set on a control, unless you explicitly apply the theme using the StyleSheetTheme property.
  •  Only one theme can be applied to each page. You cannot apply multiple themes to a page, unlike style sheets where multiple style sheets can be applied.

What are the security concerns to keep in mind when using themes?
Themes can cause security issues when they are used on your Web site. Malicious themes can be used to:
  • Alter a control's behavior so that it does not behave as expected.
  •  Inject client-side script, therefore posing a cross-site scripting risk.
  •  Expose sensitive information.
  • The mitigations for these common threats are:
  •  Protect the global and application theme directories with proper access control settings. Only trusted users should be allowed to write files to the theme directories.
  • Do not use themes from an untrusted source. Always examine any themes from outside your organization for malicious code before using them on you Web site.
  •  Do not expose the theme name in query data. Malicious users could use this information to use themes that are unknown to the developer and thereby expose sensitive information.

No comments: