zoukankan
html css js c++ java
asp.net控件开发基础(1)
简单的没事件的控件
Code
using
System;
using
System.Collections.Generic;
using
System.Text;
using
System.Web.UI;
using
System.ComponentModel;
namespace
ComponentControl
{
[DefaultProperty(
"
UserName
"
)]
//
默认选择属性
public
class
Ctrl3 : Control
{
private
string
m_UserName;
[Description(
"
登录用户名
"
)]
//
属性描述
public
string
UserName
{
get
{
return
ViewState[
"
UserName
"
]
==
null
?
"
admin
"
: ViewState[
"
UserName
"
].ToString(); }
set
{ m_UserName
=
value; }
}
private
string
m_Password;
[Description(
"
登录密码
"
)]
public
string
Password
{
get
{
return
ViewState[
"
PassWord
"
]
==
null
?
"
admin
"
: ViewState[
"
PassWord
"
].ToString(); }
set
{ m_Password
=
value; }
}
protected
override
void
Render(HtmlTextWriter writer)
{
writer.AddAttribute(HtmlTextWriterAttribute.Border,
"
1px solid #ccc
"
);
writer.RenderBeginTag(HtmlTextWriterTag.Table);
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.Write(
"
UserName :
"
);
writer.RenderEndTag();
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.AddAttribute(HtmlTextWriterAttribute.Type,
"
text
"
);
writer.AddAttribute(HtmlTextWriterAttribute.Value, UserName);
writer.AddAttribute(HtmlTextWriterAttribute.Width,
"
200px
"
);
writer.RenderBeginTag(HtmlTextWriterTag.Input);
writer.RenderEndTag();
writer.RenderEndTag();
writer.RenderEndTag();
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.Write(
"
PassWord :
"
);
writer.RenderEndTag();
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.AddAttribute(HtmlTextWriterAttribute.Type,
"
password
"
);
writer.AddAttribute(HtmlTextWriterAttribute.Width,
"
200px
"
);
writer.AddAttribute(HtmlTextWriterAttribute.Value, Password);
writer.RenderBeginTag(HtmlTextWriterTag.Input);
writer.RenderEndTag();
writer.RenderEndTag();
writer.RenderEndTag();
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
writer.AddAttribute(HtmlTextWriterAttribute.Colspan,
"
2
"
);
writer.AddAttribute(HtmlTextWriterAttribute.Align,
"
center
"
);
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.AddAttribute(HtmlTextWriterAttribute.Type,
"
button
"
);
writer.AddAttribute(HtmlTextWriterAttribute.Value,
"
Test
"
);
writer.RenderBeginTag(HtmlTextWriterTag.Input);
writer.RenderEndTag();
writer.RenderEndTag();
writer.RenderEndTag();
writer.RenderEndTag();
//
base.Render(writer);
}
}
}
,
这个送给你!
查看全文
相关阅读:
目录 —— C语言数据结构与算法分析
目录 —— STM32裸机
目录 —— FreeRTOS
常用存储器介绍
DMA(Data Memory Access)直接存储器访问
命令
文件数据流向
野指针产生的原因
内存四区
SVG 是什么?
原文地址:https://www.cnblogs.com/di305449473/p/1245323.html
最新文章
我是怎样开始职业生涯的
现实中的数字化生存
R12_专题知识总结提炼-AP模块
css3 去掉点击高光(移动端)
javascript算法汇总(持续更新中)
OpenGL学习总结
Win32 编程 基础
Action Script 3.0入门基本概念——IDE&编译与运行
Python Django的安装配置
Coursera Algorithms week1 查并集 练习测验:1 Social network connectivity
热门文章
Coursera Algorithms Programming Assignment 1: Percolation(100分)
2017 寒假作业 (三)
2017 寒假作业 (二)
2017 寒假作业 (一) 随笔
2. mysql 语句
1. Mysql在java中的使用步骤
1. AMQP 0-9-1模型简介(官网直译)
2.在Jenkins中配置及执行 maven + selenium + testng项目
Maven安装与使用
1.Jenkins 在windows下的安装与配置
Copyright © 2011-2022 走看看