어떻게 사용자 정의 컨트롤에 대해 알아 css 클래스 ASP.NET
-
09-06-2019 - |
문제
이 없기 때문에 머리글 섹션에서 사용자 컨트롤 asp.net 사용자 컨트롤 방법에 대해 알고 있는 스타일 파일입니다.그래서 css 클래스에 사용자 정의 컨트롤 의해 인식되지 않는 visual studio 생산하고 경고합니다.나는 어떻게 사용자를 제어하는 것과 관련 css 클래스는 경우,그래서 그가 저를 경고에 대해 기존 css 클래스는 것을 의미 클래스하지 않는 정말 존재하는가?
편집:거나 병원에 가야 하는 다른 디자인처럼 노출 css 클래스로 속성이 좋아요"HeaderStyle-가져오거나 설"의트?
해결책
여기에 내가 무슨 짓을했는지:
<link rel="Stylesheet" type="text/css" href="Stylesheet.css" id="style" runat="server" visible="false" />
그것은 바보 Visual Studio 생각으로 추가했습 스타일 시트가 페이지 하지만 그렇지 않을 얻을 렌더링됩니다.
여기에 더욱 간결한 방식으로 이렇게하려면 여러 참조;
<% if (false) { %>
<link rel="Stylesheet" type="text/css" href="Stylesheet.css" />
<script type="text/javascript" src="js/jquery-1.2.6.js" />
<% } %>
에서 볼 수 있듯이 이 블로그 게시물 에서 필 Haack.
다른 팁
추가 스타일에 정렬하고 가져 오기에서 css 로습니다.
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="WCReportCalendar.ascx.vb"
Inherits="Intra.WCReportCalender" %>
<style type='text/css'>
@import url("path of file.css");
// This is how i used jqueryui css
@import url("http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css");
</style>
your html
당신이 사용할 수 있는 CSS
에 직접 userControl
.
이 UserControl
:
<head>
<title></title>
<style type="text/css">
.wrapper {
margin: 0 auto -142px;
/* the bottom margin is the negative value of the footer's height */
}
</style>
</head>
이 작동합니다.
제휴하지 않습니다 StackOverflow