留言簿

我要留言
留言搜索

2009-09-14 15:04  cnblogs CodeLife

留言版这里的分页也是用这个控件做的么?
回复:您好,留言簿中的分页用的是MvcPager,不是AspNetPager,因为这个主页是用ASP.NET MVC开发的。

2009-09-14 09:54  刘强

支持杨哥继续做分页控件
回复:谢谢支持!

2009-09-12 14:47  余魁

网站用mvc写的?能否给份源代码?我正在学习mvc.找不到好的例子.
回复:您好,这个主页是重新用MVC写的,不过因为时间不多,匆匆忙忙,没有好的架构甚至没有多少注释,所以不建议初学者用来做为学习的示例,另外也关系到网站的安全,所以无法提供源代码,请谅解。asp.net MVC已问世快两年了,网上的例子已经不少了,微软官方甚至也提供了oxite这个示例,您看到 http://www.codeplex.com/oxite 看看。谢谢!

2009-09-12 13:59  wangzheng

你好,你的分页控件变的的却很好,但我用的时候怎么不能调整PagingButtonSpacing这个属性,不论我怎么调都不能改变button之间的距离
回复:您用的什么浏览器?什么版本的分页控件?在分页控件生成的html源代码中有类似于style="margin-right:5px;"这样的代码吗?

2009-01-21 12:52  hanyuice

能不能给几个不用存储过程的例子呢?<br>是否只需要指定recordcount属性就可以了吗?我按照这样做了之后,发现可以分页,但不能出现跳转,所以数据还是在一页显示!
回复:您好,示例项目中就有不用存储过程的例子了。

2009-01-16 14:44  zhongmr

后台的代码: <br>protected void BindDataView1()<br>    {<br>        string strSql = GetCondition();<br>        DB db = new DB();<br>        DataSet ds = db.GetRecByDataSet(strSql);<br> GridView1.DataSource = ds.Tables[0];<br>        GridView1.DataKeyNames = new string[] { &quot;BillID&quot; };//主键<br>        GridView1.DataBind();<br>        AspNetPager1.RecordCount = GridView1.PageCount * GridView1.PageSize;<br>}<br>protected void AspNetPager1_PageChanged(object sender, EventArgs e)<br>    {<br>        this.GridView1.PageIndex = AspNetPager1.CurrentPageIndex - 1;<br>        BindDataView1();<br>    }<br><br>页面代码<br>&lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; runat=&quot;server&quot;&gt; <br>           &lt;ContentTemplate&gt;<br>           &lt;tr&gt;<br>          &lt;td align=&quot;left&quot;&gt; &lt;webdiyer:aspnetpager id=&quot;AspNetPager1&quot; runat=&quot;server&quot; PageSize=&quot;15&quot; <br>                AlwaysShow=&quot;True&quot; OnPageChanged=&quot;AspNetPager1_PageChanged&quot; <br>                ShowCustomInfoSection=&quot;Left&quot; CustomInfoSectionWidth=&quot;240px&quot; <br>                ShowPageIndexBox=&quot;always&quot; PageIndexBoxType=&quot;DropDownList&quot;<br>    <br>                CustomInfoHTML=&quot;第&lt;font color='red'&gt;&lt;b&gt;%currentPageIndex%&lt;/b&gt;&lt;/font&gt;页,共%PageCount%页,每页显示%PageSize%条记录&quot; <br>                PagingButtonSpacing=&quot;6px&quot;&gt;&lt;/webdiyer:aspnetpager&gt;&lt;/td&gt;&lt;/tr&gt;  <br>            &lt;asp:GridView ID=&quot;GridView1&quot;  BorderColor=&quot;#6C7DA2&quot; runat=&quot;server&quot; <br>                    AutoGenerateColumns=&quot;False&quot; Width=&quot;1000px&quot; <br>                    OnRowDataBound=&quot;GridView1_RowDataBound&quot; AllowPaging=&quot;True&quot; PageSize=&quot;15&quot;  <br>                    OnRowCommand=&quot;GridView1_RowCommand&quot; onrowediting=&quot;GridView1_RowEditing&quot; &gt;<br>            &lt;Columns&gt;<br>。。。<br><br>                 &lt;/Col

2009-01-16 14:34  zhongmr

先谢谢控件的作者!<br>看了那些留言的内容使我受益匪浅!<br>那个楼下的找不到资源文件的问题,可以删除Wuqi.Webdiyer.AspNetPager项目下文件aspnetpager.cs前面+号点开后,下面的AspNetPager.en.resx这个文件!呵呵。我一开始也在弄这个问题!我下的版本是7.2的!<br>看了作者的源码,我有个疑问,查询后将数据在gridview中显示,要实现无刷新分页,我将gv和分页控件都放如UpdatePanel中,点分页页面还是抖动的!怎么实现!

2009-01-16 13:57  awoya

create   PROCEDURE [dbo].[HouseInfo_GetOrderNumber]<br>AS<br> select count(ID) from HouseInfo<br> RETURN<br><br>GO<br><br><br>总是提示:<br>为过程或函数 HouseInfo_Pager 指定的参数太多。<br><br>我使用7.2+SQL2000请指点,谢谢!!

2009-01-16 13:55  awoya

protected void Page_Load(object sender, EventArgs e)<br>    {<br>        if (!IsPostBack)<br>        {<br>            int totalOrders = (int)ynfwClass.ExecuteScalar(CommandType.StoredProcedure, &quot;HouseInfo_GetOrderNumber&quot;);<br>            AspNetPager1.RecordCount = totalOrders;<br>            bindData();<br>        }<br>    }<br><br>    public void bindData()<br>    {<br>        Repeater1.DataSource = ynfwClass.ExecuteReader(CommandType.StoredProcedure, &quot;HouseInfo_Pager&quot;,<br>             new SqlParameter(&quot;@startIndex&quot;, AspNetPager1.StartRecordIndex),<br>             new SqlParameter(&quot;@endIndex&quot;, AspNetPager1.EndRecordIndex));<br>        Repeater1.DataBind();<br>    }<br><br>    public void AspNetPager1_PageChanged(object src, EventArgs e)<br>    {<br>        bindData();<br>       <br>    }

2009-01-15 15:43  fqmail

使用vs2005开发wap,AspNetPager使用有问题。<br><br>wap2.0使用xhtml mobile,能识别div,不存在问题。<br>wap1.0使用wml,既不识别table,也不识别div。引起页面异常。<br><br>建议:LayoutType属性只有Table和Div两个枚举。如果再加上个Empty,外部不包裹任何的html容器可解决此问题。
;