本人最近用了一个urlrewriter.dll测试
经过配置后,倒是实现了一部分重写,但在datagridview或datalist中显示的数据条目仍然是xxx.aspx?id=n,没有实现,呵,有没有简单有效的办法呢
是不是非得用代码一条条输出呢?已经实现的重写的代码是:
比如放一个label控件,从数据库读数据:
label1.text+=<a href=+dr["id"].tostring()+'html'>dr["title"].tostring()</a>+<br>可以成功指向detail.aspx?id=n

解决方案 »

  1.   

    http://kwon.iteye.com/blog/9781795、分页必须引用以下方法ActionlessForm.dll
    namespace ActionlessForm 

        public class Form : System.Web.UI.HtmlControls.HtmlForm 
        { 
            protected override void RenderAttributes(HtmlTextWriter writer) 
            { 
                writer.WriteAttribute("name", this.Name); 
                base.Attributes.Remove("name"); 
                writer.WriteAttribute("method", this.Method); 
                base.Attributes.Remove("method"); 
                this.Attributes.Render(writer); 
                base.Attributes.Remove("action"); 
                if (base.ID != null) 
                    writer.WriteAttribute("id", base.ClientID); 
            } 
        } 
    }
      

  2.   

    http://zhidao.baidu.com/question/135552082.html
    http://www.cnblogs.com/HD/archive/2005/06/21/178367.html
      

  3.   

    我没提分页,那些文章以前全看过了。
    我提的是grid中为啥还是xxx.aspx?id=nnn