我现在只能发表100的贴子~!结贴前加分!
以aspnetpager为例,我想做一个自己的控件,不知如何下手~!
分页控件的原理是什么?
以aspnetpager为例,我想做一个自己的控件,不知如何下手~!
分页控件的原理是什么?
解决方案 »
- c#异常:Object reference not set to an instance of an object问题,谢谢
- 在webbrowser中如何给type=file的附值
- 第一次加载Crystal Reports Viewer 时出现问题,希望专家给予指导
- C#调用RAPI中的CeFindAllfiles函数时,如何设置其参数
- 关于通过网络传输文件的问题
- 关于:线程的问题,如何找到指定的线程,并结束该线程等。
- 多线程跟踪调试问题
- 很基础的问题
- 一个关于 事件接口的问题
- 请问怎样在asp.net(c#)里实现与手机之间互发短信的功能呀!谢谢了,急用!
- Assembly loadFile的问题
- 参数返回的问题
2、在解决方案资源管理器中右键单击—添加—新建项
3、选择Web用户控件
4、单击添加按钮。
5、打开新建的那个后缀名ascx的文件。
6、编辑(随便画几个表格,弄张图片)。
7、保存。
8、这时,一个用户自定义控件就算做好了,可以把刚才新建的文件(控件)随意拖到想用的地方。
还有,有变动,我后天才能上车,所以贴子要大后天才能结~!
2.重写Render(HtmlTextWriter writer)实现功能,
3.编译成类库
4.在应用的工程的工具箱内添加选择项,拖进页面就行了,系统会自动注册控件的
只不过是继承一些微软些好的软件 然后加功能 改写下等等...
像AspNetPager:using System;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Text;
using System.Web.UI;
using System.Web.UI.Design.WebControls;
using System.Web.UI.WebControls;
using System.Web;
using System.Resources;
using System.Globalization;
using System.Security.Permissions;
using System.Text.RegularExpressions;namespace FrameWork.WebControls
{
#region AspNetPager Server Control /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Class[@name="AspNetPager"]/*'/>
[AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
[DefaultProperty("PageSize")]
[DefaultEvent("PageChanged")]
[ParseChildren(false)]
[PersistChildren(false)]
[ANPDescription("desc_AspNetPager")]
[Designer(typeof(PagerDesigner))]
[ToolboxData("<{0}:AspNetPager runat=server></{0}:AspNetPager>")]
public class AspNetPager : Panel, INamingContainer, IPostBackEventHandler, IPostBackDataHandler
{
#region Private fields private string cssClassName;
private string inputPageIndex;
private string currentUrl = null;
private NameValueCollection urlParams = null;
private AspNetPager cloneFrom = null;
private static readonly object EventPageChanging = new object();
private static readonly object EventPageChanged = new object();
//AspNetPager Version information
const string ver = "6.0.0"; #endregion #region Properties #region Navigation Buttons /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ShowNavigationToolTip"]/*'/>
[Browsable(true), ANPCategory("cat_Navigation"), DefaultValue(false), ANPDescription("desc_ShowNavigationToolTip"), Themeable(false)]
public bool ShowNavigationToolTip
{
get
{
if (null != cloneFrom)
return cloneFrom.ShowNavigationToolTip;
object obj = ViewState["ShowNvToolTip"];
return (obj == null) ? false : (bool)obj;
}
set
{
ViewState["ShowNvToolTip"] = value;
}
} /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NavigationToolTipTextFormatString"]/*'/>
[Browsable(true), Themeable(false), ANPCategory("cat_Navigation"), ANPDefaultValue("def_NavigationToolTipTextFormatString"), ANPDescription("desc_NavigationToolTipTextFormatString")]
public string NavigationToolTipTextFormatString
{
get
{
if (null != cloneFrom)
return cloneFrom.NavigationToolTipTextFormatString;
object obj = ViewState["NvToolTipFormatString"];
if (obj == null)
{
if (ShowNavigationToolTip)
return SR.GetString("def_NavigationToolTipTextFormatString");
return null;
}
return (string)obj;
}
set
{
string tip = value;
if (tip.Trim().Length < 1 && tip.IndexOf("{0}") < 0)
tip = "{0}";
ViewState["NvToolTipFormatString"] = tip;
}
} /// <include file='AspnetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NumericButtonTextFormatString"]/*'/>
[Browsable(true), Themeable(false), DefaultValue(""), ANPCategory("cat_Navigation"), ANPDescription("desc_NBTFormatString")]
public string NumericButtonTextFormatString
{
get
{
if (null != cloneFrom)
return cloneFrom.NumericButtonTextFormatString;
object obj = ViewState["NumericButtonTextFormatString"];
return (obj == null) ? String.Empty : (string)obj;
}
set
{
ViewState["NumericButtonTextFormatString"] = value;
}
} /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="PagingButtonType"]/*'/>
[Browsable(true), Themeable(false), DefaultValue(PagingButtonType.Text), ANPCategory("cat_Navigation"), ANPDescription("desc_PagingButtonType")]
public PagingButtonType PagingButtonType
{
get
{
if (null != cloneFrom)
return cloneFrom.PagingButtonType;
object obj = ViewState["PagingButtonType"];
return (obj == null) ? PagingButtonType.Text : (PagingButtonType)obj;
}
set
{
ViewState["PagingButtonType"] = value;
}
} /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NumericButtonType"]/*'/>
[Browsable(true), Themeable(false), DefaultValue(PagingButtonType.Text), ANPCategory("cat_Navigation"), ANPDescription("desc_NumericButtonType")]
public PagingButtonType NumericButtonType
{
get
{
if (null != cloneFrom)
return cloneFrom.NumericButtonType;
object obj = ViewState["NumericButtonType"];
return (obj == null) ? PagingButtonType : (PagingButtonType)obj;
}
set
{
ViewState["NumericButtonType"] = value;
}
} /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="NavigationButtonType"]/*'/>
[Browsable(true), Themeable(false), ANPCategory("cat_Navigation"), DefaultValue(PagingButtonType.Text), ANPDescription("desc_NavigationButtonType")]
public PagingButtonType NavigationButtonType
{
get
{
if (null != cloneFrom)
return cloneFrom.NavigationButtonType;
object obj = ViewState["NavigationButtonType"];
return (obj == null) ? PagingButtonType : (PagingButtonType)obj;
}
set
{
ViewState["NavigationButtonType"] = value;
}
} /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="MoreButtonType"]/*'/>
[Browsable(true), Themeable(false), ANPCategory("cat_Navigation"), DefaultValue(PagingButtonType.Text), ANPDescription("desc_MoreButtonType")]
public PagingButtonType MoreButtonType
{
get
{
if (null != cloneFrom)
return cloneFrom.MoreButtonType;
object obj = ViewState["MoreButtonType"];
return (obj == null) ? PagingButtonType : (PagingButtonType)obj;
}
set
{
ViewState["MoreButtonType"] = value;
}
}...