- 热门文章:
- · 一个实现自定义event的文章。。。我还没有完全摸透。。不知道有没人有兴趣。。新手就不用看了,先学会走...
- · Server.Transfer,Response.Redirect 和 Page.Navigate 的区别
- · ASP.NET发送ICQ消息DIY
- · web页面用水晶报表的例子
- · Creating Custom Portal Modules
- · 几个.net的重要问题
- · SQL命令中DateTime格式参考
- · 关于webcontrol和pagelet的一点看法
- · 关于.net的几个重要问题的bigeagle版本
- · 关于datagrid的使用以及动态修改,以及使用存储过程的介绍
- · 转阿土伯推荐的文章:在 VS.NET 中编写 Web 应用程序(附图)(推荐)
- · 转新技术网:在ASP.NET中使用.NET组件
上一篇:.Net边学边讲(一) >>
里面是对一个body的属性进行server的一些设定,不过可以衍生到其他的一些htmlcontrol新手看看,或者有点...
The second method uses the Style object property of the HtmlControl object. By making calls to the Style object property@#s Add method, you can add custom styles to your <body> tag. These are implemented as an inline style tag when it is rendered to the browser.
Because of this, you may want to research whether the style you are going to implement is compatible with the browser you are targeting.
The techniques used here can be used to set the properties of any HTML control that does not have a Server Control equivalent. An example would be the <p> tag.
Sample code 1: Use the "Attributes" collection of the body tag
<%@ Page Language="C#" %>
<script language="C#" runat="server">
protected void Page_Load(object sender, EventArgs e) {
body.Attributes["BgColor"] = "#CCCCCC";
}
</script>
<body id="body" runat="server">
This is the body text.
</body>
Sample Code 2: Use the "Style" collection of the body tag
<%@ Page Language="C#" %>
<script language="C#" runat="server">
protected void Page_Load(object sender, EventArgs e) {
body.Style.Add("background-color","#CCCCCC");
}
</script>
<body id="body" runat="server">
This is the body text.
</body>
Notes:
Be sure to add the runat="server" attribute to your body tag and give it an ID
相关文章:
- · 自己写的一个资料验证的asp.net程序,大家看看吧!
- · 关于在ASP.NET 中进行调试的方法(转载自itpeople),不过我个人对第三招不以为然,有了vs.net还要那个...
- · 菜鸟入门篇---有关ASP.NET的一些基本说明,解释. [页面标识]
- · 我的第一个ASP+程序,如果是新手请进来看吧。谢绝高手。:)
- · Security Hole In ASP.NET Beta 1 (from angryCoder)
- · 关于从toolbox内拖放控件到form时出错的解决办法
- · XML、DataSet、DataGrid结合写成广告管理程序(上)(转载)
- · XML、DataSet、DataGrid结合写成广告管理程序(下)(转载)
- · 我的aspx为什么无法显示中文?
- · web窗口间的互相控制
- · BigEagle的数据库结构(转载,一动手,就轻拿5分)
- · 转雨天妹妹的文章:TreeView的DHTML实现(可以实现拖动效果哟)
- · 吐血奉献:如何搞定DataGrid 分栏的大小(即DataGrid的可视化控制).
- · Is your .NET Code safe?
- · Introduction to .NET Reflection
- · .net里面的数值格式变换
- · Picture Numeric Format Strings(我很难解释大家自己看)
- · 数值变换时的格式化字符举例
- · Numeric Parse Method
- · 日期和时间的转换
- · 自定义的转换格式
- · 如何将powerpoint转换为html
- · css设定表格宽度
- · .Net边学边讲(三)
- · Calling a Button Event from a Compiled DLL
- · datagrid怎么设置分页?
- · .NET之ASP Web Application快速入门(3)(转载)
- · .NET之ASP WebApplication快速入门(4)(转载)
- · .NET之ASP WebApplication快速入门(5)(转载)
- · .NET之ASP Web Application快速入门(1)(转载)
- · .NET之ASP Web Application快速入门(2) (转载)
- · ASP.NET中的错误处理支持
- · ASP.NET中的代码分离
- · 在ASP.NET中使用AdRotator控件(转)
- · 在ASP.NET中动态生成图形(转)
- · 用ASP.NET加密口令(转)
- · ASP.NET中的错误处理支持(转)
- · ASP.NET中发送Email完整实例(转)
