protected override void Render(HtmlTextWriter output)
{
this.Controls.Clear();
Button Button1 = new Button();
Button1.Width = 88;
Button1.Text = "建立文档";
DropDownList DropDownList1 = new DropDownList();
DropDownList1.Width = 100;
this.Controls.Add(Button1);
this.Controls.Add(DropDownList1);
this.RenderChildren(output);
}
{
this.Controls.Clear();
Button Button1 = new Button();
Button1.Width = 88;
Button1.Text = "建立文档";
DropDownList DropDownList1 = new DropDownList();
DropDownList1.Width = 100;
this.Controls.Add(Button1);
this.Controls.Add(DropDownList1);
this.RenderChildren(output);
}
解决方案 »
- ASP.NET 做一个投票的功能,用Label控件来显示票数。点击投票后它能自动加1进去。
- 急!Datalist编辑状态下Dropdownlist的联动问题?
- Listbox控件的AutoPostback失效
- DataList无法显示间隔项?急
- CuteEditor中无法保存空格,急!!
- 一个简单DLL问题(急)
- 一个简单的问题,不知道怎么的
- icsharpcode.sharpziplib.dll上传服务器上不可用
- 关于SQL数据转换为WORD格式的毕业设计问题求助!!
- create XmlDocument-object from a Xml-string
- 请问如何从数据库中选出某段时间内的帖子!
- 用sql语句合并字符串的问题,sql高手帮帮忙!急!!
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Page
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.SqlClient<DefaultProperty("Text"), ToolboxData("<{0}:WebCustomControl1 runat=server></{0}:WebCustomControl1>")> Public Class WebCustomControl1
Inherits System.Web.UI.WebControls.WebControl Dim _text As String
<Bindable(True), Category("Appearance"), DefaultValue("")> Property [Text]() As String
Get
Return _text
End Get Set(ByVal Value As String)
_text = Value
End Set
End Property
Public Label1 As Label
Dim add As New Button
Dim del As New Button
Dim value1 As New TextBox
Dim search As New Button
Dim DropDownList1 As New DropDownList
Dim compare1 As New DropDownList
Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
Controls.Clear()
add.Text = "加"
del.Text = "减"
compare1.Items.Add(New ListItem("<", "<"))
compare1.Items.Add(New ListItem("<=", "<="))
compare1.Items.Add(New ListItem("=", "="))
compare1.Items.Add(New ListItem(">", ">"))
compare1.Items.Add(New ListItem(">=", ">=")) search.Text = "查询"
AddHandler add.Click, AddressOf Me.add_Click Controls.Add(add)
Controls.Add(del)
Controls.Add(DropDownList1)
Controls.Add(compare1)
Controls.Add(value1)
Controls.Add(search)
Controls.Add(New LiteralControl("<br>"))
Label1 = New Label
Controls.Add(Label1)
RenderChildren(output)
End SubEnd Class
你试试看吧