"SmartNavigation"苗条版ClientNavigation增肥
原来做的ClientNavigation没有注意只支持保存和恢复页面的scrollTop,今天发现有个应用还需要保存一下scrollLeft,于是就把ClientNavigation增了点肥,支持scrollLeft的save/load了。放在这里算是对SmartNavigation系列文章的update吧。
价格公道,童叟无欺,欢迎使用。
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Birdshome.Web.WebControls
{
/// <summary>
/// Summary description for ClientNavigation.
/// </summary>
[DefaultProperty("Text")]
[ToolboxData("<{0}:ClientNavigation runat=server></{0}:ClientNavigation>")]
public class ClientNavigation : WebControl, INamingContainer, IPostBackDataHandler
{
public ClientNavigation() : base() {}
Properties
protected override void Render(HtmlTextWriter writer)
{
this.RegisterClientScript();
writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden");
writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
writer.AddAttribute(HtmlTextWriterAttribute.Name, this.ClientID);
writer.AddAttribute(HtmlTextWriterAttribute.Value,
string.Format("{0}:{1}", this.PositionTop,this.PositionLeft));
writer.RenderBeginTag(HtmlTextWriterTag.Input);
writer.RenderEndTag();
}
Client Script
IPostBackDataHandler interface
}
}
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Birdshome.Web.WebControls
{
/// <summary>
/// Summary description for ClientNavigation.
/// </summary>
[DefaultProperty("Text")]
[ToolboxData("<{0}:ClientNavigation runat=server></{0}:ClientNavigation>")]
public class ClientNavigation : WebControl, INamingContainer, IPostBackDataHandler
{
public ClientNavigation() : base() {}
Properties
protected override void Render(HtmlTextWriter writer)
{
this.RegisterClientScript();
writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden");
writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
writer.AddAttribute(HtmlTextWriterAttribute.Name, this.ClientID);
writer.AddAttribute(HtmlTextWriterAttribute.Value,
string.Format("{0}:{1}", this.PositionTop,this.PositionLeft));
writer.RenderBeginTag(HtmlTextWriterTag.Input);
writer.RenderEndTag();
}
Client Script
IPostBackDataHandler interface
}
}
posted on 2004-12-13 18:53 birdshome 阅读(2308) 评论(3) 编辑 收藏 举报