Web用户控件(.ascx)可以使用CSS文件进行样式设置吗? [英] Can a Web User Control (.ascx) use a CSS file for styling?

查看:178
本文介绍了Web用户控件(.ascx)可以使用CSS文件进行样式设置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我创建的名为LogOnBox的.acsx空白文件的来源.

Here's the source of a blank .acsx file I created called LogOnBox.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LogOnBox.ascx.cs" Inherits="ECommerce.Views.Shared.LogOnBox" %>

我想拖动一些标签,文本框等,并使用CSS文件为其赋予样式.如何将CSS关联到acsx文件?

I want to drag some labels, and textboxes etc and give them style using a CSS file. How can I associate a CSS to an acsx file?

推荐答案

CSS与页面关联,而不是与控件关联.但是,只要页面引用了CSS,就可以在控件中使用CSS.

The CSS is associated to the page, and not the control specifically. But you can use the CSS in the control when the page has referenced it.

这篇关于Web用户控件(.ascx)可以使用CSS文件进行样式设置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆