将外部.css应用于使用asp.net中的XSL创建的html

时间:2015-01-29 14:11:30

标签: html css asp.net xml xslt

我的方案是,当用户点击"按钮"从webform我必须创建html文件[使用xml的xs转换]并在客户端打开它作为弹出窗口。

xml转换已完成,我已准备好使用html。 我创建了PopUpReport.aspx并使用下面的代码弹出这个页面。

Session["reportHtml"] = htmlReport;//this contains the transformed html
ScriptManager.RegisterStartupScript(this, typeof(string),
 "Showing Modalpopup", "window.open('PopUpReport.aspx',  'Report', 
'width=800,height=600,scrollbars=1,resizable=1');",true);

并在PopUpReport.aspx内部

protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write(Session["reportHtml"]);
    }

现在我的问题是,

我有一个单独的.css文件,需要应用到上面的HTML页面,我应该如何在html中链接?

在xsl文件中指定以下内容无效。     

我不想要内联样式,因为它包含大量代码。

有没有办法实现这个目标?我们应该为这个PopUpReport.aspx页面使用主题吗?请帮帮我......

1 个答案:

答案 0 :(得分:-1)

在您正在调用的.aspx文件中,将CSS文件链接到头部,如下所示:

<link href="your.css" rel="stylesheet" type="text/css">

有关详细信息,请参阅http://www.w3.org/TR/html401/present/styles.html