Surance Center

没有图形化显示,继承Control类

using System;
using System.Data;
using System.Configuration;
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;

/// <summary>
/// TestRender 的摘要说明
/// </summary>

namespace USERControls
{
    
public class TestRender : System.Web.UI.Control
    
{
        
public TestRender()
        
{
            
//
            
// TODO: 在此处添加构造函数逻辑
            
//
        }



        
protected override void Render(HtmlTextWriter writer)
        
{

            writer.AddAttribute(HtmlTextWriterAttribute.Href, 
"http://www.163.com");

            writer.AddStyleAttribute(HtmlTextWriterStyle.Color, 
"red");

            writer.RenderBeginTag(HtmlTextWriterTag.A);

            writer.Write(
"dd");

            writer.RenderEndTag();

           
            
            
base.Render(writer);
        }

    }

}
posted @ 2007-06-04 20:18  xxp  阅读(227)  评论(0编辑  收藏  举报
Surance Center