문제

In a asp.net webforms project, I need to add external style sheet only to content page,

If I put css link after the <%@ Page> declaration it gives an error saying

Error   103 Validation (XHTML 1.0 Transitional): Content is not supported outside 'script' or 'asp:content' regions.

If I put it inside <asp:Content> tag error is

Error   104 Cannot switch views: Validation (XHTML 1.0 Transitional): Element 'link' cannot be nested within element 'td'.

Is it possible to add a style sheet only to content page?

도움이 되었습니까?

해결책

You should create a place holder in the head section in master page. Then in the content page, if you want to include js, css, ... put on this place holder, unless keep it empty.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top