• 大小: 1.22M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-02
  • 语言: 其他
  • 标签: 其他  

资源简介

第4章_家教信息平台.rar

资源截图

代码片段和文件信息

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

namespace Controls
{
    /// 
    /// SubmitTextbox 的摘要说明
    /// 

    public class SubmitTextbox : TextBox
    {
        [TypeConverter(typeof(SubmitableControlConvertor)) DefaultValue(““) Category(“Behavior“)]
        public string SubmitControl
        {
            get
            {
                object ret = this.ViewState[“SubmitControl“];
                if (ret != null)
                {
                    return (string)ret;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState[“SubmitControl“] = value;
            }
        }

        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            if (this.SubmitControl.Length > 0)
            {
                Control con = FindControl(SubmitControl);
                if (con != null)
                {
                    string script = “if(event.keyCode == 13){document.getElementById(‘“ + con.ClientID + “‘).click(); event.returnValue=false;}“;
                    writer.AddAttribute(“onkeydown“ script);
                }
            }
        }
    }

    public class SubmitableControlConvertor : StringConverter
    {
        private object[] GetControls(IContainer container)
        {
            ComponentCollection components = container.Components;
            ArrayList ret = new ArrayList();
            foreach (IComponent control in components)
            {
                if (!(control is Button || control is linkButton || control is ImageButton))
                {
                    continue;
                }
                Control button = (Control)control;
                if ((button.ID != null) && (button.ID.Length != 0))
                {
                    ret.Add(string.Copy(button.ID));
                }
            }
            ret.Sort(Comparer.Default);
            return ret.ToArray();
        }


        public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            if ((context != null) && (context.Container != null))
            {
                object[] controls = this.GetControls(context.Container);
                if (controls != null)
                {
                    return new TypeConverter.StandardValuesCollection(controls);
                }
            }
            return null;
        }

        public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
        {
            return false;
        }

        public 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      16186  2006-10-23 15:41  第4章_家教信息平台\1_本案例讲了什么.htm

     文件       8895  2006-11-19 22:52  第4章_家教信息平台\2_系统预览.htm

     文件       9877  2006-09-11 07:13  第4章_家教信息平台\3_如何配置本案例.htm

     文件       5140  2006-09-26 09:04  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingNet.sln

    ..A..H.       228  2006-08-29 22:39  第4章_家教信息平台\Src\HomeTeachingNet\vssver2.scc

     文件        568  2006-09-26 09:03  第4章_家教信息平台\Src\HomeTeachingNet\配置说明.txt

     文件       1423  2006-08-24 22:55  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\AdminMenu.sitemap

     文件       2640  2006-07-30 21:07  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\admin_login.aspx

     文件       1715  2006-08-29 20:23  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\admin_login.aspx.cs

     文件       1340  2006-08-29 20:24  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\ClientMenu.sitemap

     文件        704  2006-08-04 16:48  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\Default.aspx

     文件        409  2006-07-25 18:03  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\Default.aspx.cs

     文件        267  2006-08-04 15:13  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\empty.aspx

     文件        406  2006-08-04 15:13  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\empty.aspx.cs

     文件       1060  2006-08-25 22:35  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\login.aspx

     文件        406  2006-07-30 11:46  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\login.aspx.cs

     文件        936  2006-07-26 01:10  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\MasterPage.master

     文件        417  2006-07-25 06:58  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\MasterPage.master.cs

     文件       1485  2006-08-04 15:21  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\MasterPage_LeftBar.master

     文件        425  2006-07-26 03:30  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\MasterPage_LeftBar.master.cs

     文件        431  2006-08-29 20:26  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\ModifyPwd.aspx

     文件        410  2006-08-29 20:25  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\ModifyPwd.aspx.cs

     文件        441  2006-08-03 22:35  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\result.aspx

     文件        407  2006-07-28 08:22  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\result.aspx.cs

     文件        486  2006-08-03 22:35  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\search.aspx

     文件        407  2006-07-26 04:50  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\search.aspx.cs

     文件        489  2006-08-03 22:35  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\search_teacher.aspx

     文件        415  2006-07-26 05:32  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\search_teacher.aspx.cs

     文件        447  2006-08-03 22:35  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\student_reg.aspx

     文件        412  2006-07-28 05:16  第4章_家教信息平台\Src\HomeTeachingNet\HomeTeachingWeb\student_reg.aspx.cs

............此处省略256个文件信息

评论

共有 条评论