用户操作
[即时聊天] [发私信] [加为好友]
ZPTID:IamBird
28771次访问,排名4483(1),好友0人,关注者2人。
IamBird的文章
原创 35 篇
翻译 0 篇
转载 18 篇
评论 8 篇
ZPT的公告
最近评论
dddfffddff123:那这样的话服务器主机就要支持.NET咯,是不是啊?
这样对服务器要求挺高的呀。
wszhoho:这些代码你真的测试过吗,我测试了第一种就失败了。
fmfeggman:兄弟 我试了你的方法好想不行
url=http://localhost:1323/WebSite6/Service.asmx/方法名;
url会报错
宽带用户:谁有权制定法律?只有议会
阿标:好文章!
文章分类
收藏
    相册
    asp.net
    我同事非说这个网赚很灵,陪她玩一下试试
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 Asp.net可输入下拉框服务器控件 C#版 收藏

    新一篇: 关于项目管理的知识点 | 旧一篇: DataGrid中dropdownlist事件的触发ImageButton的事件触发

    //备注:改自Ryan Liu (dpliu@cbdsystem.com.cn)vb.net
    using System;
    using System.Collections;
    using System.ComponentModel; 
    using System.Web.UI; 
    using System.Web.UI.Design; 
    using System.Web.UI.WebControls; 

    namespace CBDAspNet.WebControls.HTML 

    [ToolboxData("<{0}:TextBox runat=\"server\" />")
    public class TextBox : System.Web.UI.WebControls.TextBox 

    private Hashtable _values; 
    public DropDownList _DropDownList; 

    public TextBox() 

    _DropDownList = new DropDownList(); 
    _values = new Hashtable(); 


    public Hashtable Values 

    get 

    return _values; 

    set 

    _values = value; 



    protected override void Render(System.Web.UI.HtmlTextWriter Output) 

    int iWidth = Convert.ToInt32(base.Width.Value); 
    if (iWidth == 0) 

    iWidth = 102; 

    int sWidth = iWidth + 16; 
    int spanWidth = sWidth - 18; 
    Output.Write("<div style=\"POSITION:relative\">")
    Output.Write("<span style=\"MARGIN-LEFT:" + spanWidth + "px;OVERFLOW:hidden;WIDTH:18px\">")
    _DropDownList.Width = Unit.Parse(sWidth + "px")
    _DropDownList.Style.Add("MARGIN-LEFT", "-" + spanWidth + "px")
    _DropDownList.Attributes.Add("onchange", "this.parentNode.nextSibling.value=this.value")
    if (_values.Count > 0) 

    foreach (string key in _values.Keys) 

    ListItem item = new ListItem(); 
    item.Value = key; 
    item.Text = _values[key].ToString(); 
    _DropDownList.Items.Add(item); 



    //如果只有一个可选内容
    if (_DropDownList.Items.Count == 1) 

    ListItem item = new ListItem(); 
    item.Value = ""; 
    item.Text = " "; 
    _DropDownList.Items.Add(item); 
    _DropDownList.SelectedIndex = 1; 

    _DropDownList.RenderControl(Output); 
    Output.Write("</span>")
    base.Style.Clear(); 
    base.Width = Unit.Parse(iWidth + "px")
    base.Style.Add("left", "0px")
    base.Style.Add("POSITION", "absolute")
    base.Render(Output); 
    Output.Write("</div>")


    }
     

    发表于 @ 2006年09月21日 09:51:00|评论(loading...)|编辑

    新一篇: 关于项目管理的知识点 | 旧一篇: DataGrid中dropdownlist事件的触发ImageButton的事件触发

    评论:没有评论。

    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © ZPT