代码
1首先制作一个自定义控件
2重点是皮肤和标题都可以自定义啊
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ModuleTitle.ascx.cs" Inherits="UserControl_ModuleTitle" %>
<table class="Table" bgcolor="#D8E7FA" width="100%" cellpadding="0" 
    cellspacing
="0" border="1" 
    
>        
    
<tr>
        
<td background='<%# Request.ApplicationPath + "/App_Themes/MRSOFTASPNET/Images/1.jpg" %>' colspan="2" style="height: 25px">
            
<table height="25" cellpadding="0" cellspacing="0" border="0">
                
<tr>
                    
<td height="25" valign="middle" align="center">&nbsp;&nbsp;&nbsp;<asp:Image ID="bgImage" runat="server" ImageUrl="~/App_Themes/MRSOFTASPNET/Images/会员界面/论坛.png" Height="18px" /></td>
                    
<td><font class="ModuleTitle">&nbsp;&nbsp;<b><%=title %></b></font></td>
                
</tr>
            
</table>
        
</td>
    
</tr>        
</table>


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UserControl_ModuleTitle:System.Web.UI.UserControl
{
    
/// <summary>
    
/// 模块的标题
    
/// </summary>
    protected string title;
    
public string Title
    {
        
get
        {
            
return (title);
        }
        
set
        {
            title 
= value;
        }
    }

    
protected void Page_Load(object sender,EventArgs e)
    {   
///绑定数据
        this.DataBind();
    }
}

 

posted on 2010-11-19 10:34  苹果妖怪  阅读(196)  评论(0)    收藏  举报