谁如果有更直接的方法请不吝赐教也不知有什么方法可以直接更换css
<%@ Page Language=C# AutoEventWireup=true CodeFile=Defaultaspxcs Inherits=_Default %>
<!DOCTYPE html PUBLIC //WC//DTD XHTML Transitional//EN transitionaldtd>
<html xmlns= >
<head runat=server>
<title>红色庄重</title>
<link rel=stylesheet type=text/css />
<asp:placeholder runat=server ID=phCss></asp:placeholder>
</head>
<body>
<form id=form runat=server>
</form>
</body>
</html>
using System;
using SystemData;
using SystemConfiguration;
using SystemWeb;
using SystemWebSecurity;
using SystemWebUI;
using SystemWebUIWebControls;
using SystemWebUIWebControlsWebParts;
using SystemWebUIHtmlControls;
public partial class _Default : SystemWebUIPage
{
protected void Page_Load(object sender EventArgs e)
{
if (!IsPostBack)
BindCss();
}
private void BindCss()
{
HtmlGenericControl objLink = new HtmlGenericControl(LINK);
objLinkAttributes[rel] = stylesheet;
objLinkAttributes[type] = text/css;
objLinkAttributes[href] = css/commoncss;
phCssControlsAdd(objLink);
}
}