留言簿

我要留言
留言搜索

2007-01-23 16:57  wtsdesigner

你好吴兄弟.我的WTS分页三剑侠1.0正式版+项目源代码 也发布了.在开发中.JavaScript方面在你的源代码中给了我好多参考.我们可以在这方面作个交流吗?<br>请到http://wtsdesigner.ik8.com/参观一下.
回复:很好,支持共享,有空多交流,谢谢!

2007-01-22 18:08  yanger

你好!我用了你的分页控件,实在是太棒啦!但是有的问题我还是没有办法解决。<br>我使用了Urlrewrite组件,里面使用了你的分页控件,http://localhost:8001/null/3/0/0/SearchResult0.aspx。但是我使用了你的控件分页的url分页方式的话会出现http://localhost:8001/null/3/0/0/SearchResult0.aspx?Name=null&amp;Star=3&amp;Price=0&amp;Canton=0&amp;PageIndex=0&amp;page=6。就是说参数出现了2次。请问这个问题是怎么解决才好了。谢谢<br>回复:哪个参数出现了两次呢?您是否启用了Url重写功能?如果是的话UrlRewritePattern又是如何写的呢?谢谢!<br><br>你好!<br>我的页面使用UrlRewrite组件,对url进行了重写了,我现在要对查询页面使用UrlPaging。那么请问UrlRewritePattern 应该怎么写才好那?<br>回复:您要重写为什么样的路径呢?真实的页面路径又是什么样的呢?谢谢!路径是<br>http://localhost:8001/null/3/0/0/SearchResult0.aspx。<br>真实的路径是http://localhost:SearchResult.aspx?a=null&amp;b=2&amp;c=0&amp;d=0&amp;e=0。<br>我要重新的目的是为了seo。但是用了分页组件的话,并且用Url重新,我就没有办法解决啦
回复:重写后的url中3是从哪来的呢?如果是参数b的值的话,那么AspNetPager的UrlRewritePattern应该是:"null/%b%/%c%/searchresult%e%.aspx",不过这里还有一个问题:您把AspNetPager分页控件的分页参数丢掉了,这个参数也应该被加入到重写后的url中,否则重写后就无法实现分页了,分页参数的值可以用“{0}”来代替,请参考控件帮助文档。谢谢!

2007-01-22 16:26  liyunlong

如果创建存储过程时使用了自定义变量,则必须在代码中手工加入变量赋值代码!<br><br><br>我用了自定义变量........<br>用以下的代码.无法产生分页<br>请问如何手工加入变量赋值代码!<br><br><br>SqlConnection conn;<br>SqlCommand cmd;<br>void Page_Load(object src,EventArgs e){<br>conn=new SqlConnection(ConfigurationSettings.AppSettings[&quot;ConnStr&quot;]);<br>if(!Page.IsPostBack){<br>cmd=new SqlCommand(&quot;GetProductsInCategoryintCount&quot;,conn);<br>cmd.CommandType=CommandType.StoredProcedure;<br>cmd.Parameters.Add(&quot;@pageindex&quot;,1);<br>cmd.Parameters.Add(&quot;@pagesize&quot;,1);<br>cmd.Parameters.Add(&quot;@docount&quot;,true);<br>conn.Open();<br>pager1.RecordCount=(int)cmd.ExecuteScalar();<br>conn.Close();<br>BindData();<br>}<br>}<br><br>void BindData(){<br>cmd=new SqlCommand(&quot;GetProductsInCategoryintCount&quot;,conn);<br>cmd.CommandType=CommandType.StoredProcedure;<br>cmd.Parameters.Add(&quot;@pageindex&quot;,pager1.CurrentPageIndex);<br>cmd.Parameters.Add(&quot;@pagesize&quot;,pager1.PageSize);<br>cmd.Parameters.Add(&quot;@docount&quot;,false);<br>conn.Open();<br>list.DataSource=cmd.ExecuteReader();<br>list.DataBind();<br>conn.Close();<br>}<br>void ChangePage(object src,PageChangedEventArgs e){<br>pager1.CurrentPageIndex=e.NewPageIndex;<br>BindData();<br>}<br><br><br><br>CREATE procedure GetProductsInCategoryintCount<br>(@CategoryID int,<br>@pagesize int,<br>@pageindex int,<br>@docount bit)<br>as<br>set nocount on<br>if(@docount=1)<br>select count(ProductID) from Product where categoryid = @categoryid<br>else<br>begin<br>declare @indextable table(id int identity(1,1),nid int)<br>declare @PageLowerBound int<br>declare @PageUpperBound int<br>set @PageLowerBound=(@pageindex-1)*@pagesize<br>set @PageUpperBound=@PageLowerBound+@pagesize<br>set rowcount @PageUpperBound<br>insert into @indextable(nid) select ProductID from Product where categoryid = @categoryid order by ProductID desc<br>select O.* from Product O,@indextable t where O.ProductID=t.nid<br>and t.id&gt;@PageLowerBound and t.id&lt;=@PageUpperBound order by t.id<br>end<b
回复:应该是这样: cmd.Parameters.Add("@CategoryID",CategoryID变量的值); cmd.Parameters.Add("@pageindex",pager1.CurrentPageIndex); cmd.Parameters.Add("@pagesize",pager1.PageSize); cmd.Parameters.Add("@docount",false);

2007-01-22 16:25  liyunlong

SqlConnection conn;<br>SqlCommand cmd;<br>void Page_Load(object src,EventArgs e){<br>conn=new SqlConnection(ConfigurationSettings.AppSettings[&quot;ConnStr&quot;]);<br>if(!Page.IsPostBack){<br>cmd=new SqlCommand(&quot;GetProductsInCategoryintCount&quot;,conn);<br>cmd.CommandType=CommandType.StoredProcedure;<br>cmd.Parameters.Add(&quot;@pageindex&quot;,1);<br>cmd.Parameters.Add(&quot;@pagesize&quot;,1);<br>cmd.Parameters.Add(&quot;@docount&quot;,true);<br>conn.Open();<br>pager1.RecordCount=(int)cmd.ExecuteScalar();<br>conn.Close();<br>BindData();<br>}<br>}<br><br>void BindData(){<br>cmd=new SqlCommand(&quot;GetProductsInCategoryintCount&quot;,conn);<br>cmd.CommandType=CommandType.StoredProcedure;<br>cmd.Parameters.Add(&quot;@pageindex&quot;,pager1.CurrentPageIndex);<br>cmd.Parameters.Add(&quot;@pagesize&quot;,pager1.PageSize);<br>cmd.Parameters.Add(&quot;@docount&quot;,false);<br>conn.Open();<br>list.DataSource=cmd.ExecuteReader();<br>list.DataBind();<br>conn.Close();<br>}<br>void ChangePage(object src,PageChangedEventArgs e){<br>pager1.CurrentPageIndex=e.NewPageIndex;<br>BindData();<br>}<br><br><br><br>CREATE procedure GetProductsInCategoryintCount<br>(@CategoryID int,<br>@pagesize int,<br>@pageindex int,<br>@docount bit)<br>as<br>set nocount on<br>if(@docount=1)<br>select count(ProductID) from Product where categoryid = @categoryid<br>else<br>begin<br>declare @indextable table(id int identity(1,1),nid int)<br>declare @PageLowerBound int<br>declare @PageUpperBound int<br>set @PageLowerBound=(@pageindex-1)*@pagesize<br>set @PageUpperBound=@PageLowerBound+@pagesize<br>set rowcount @PageUpperBound<br>insert into @indextable(nid) select ProductID from Product where categoryid = @categoryid order by ProductID desc<br>select O.* from Product O,@indextable t where O.ProductID=t.nid<br>and t.id&gt;@PageLowerBound and t.id&lt;=@PageUpperBound order by t.id<br>end<br>set nocount off<br>GO

2007-01-22 10:58  salough

我用的是sql2000数据库。存储过程和samples对不上。
回复:修改一下web.config中appSettings配置节中的,把其中的P_GetPagedOrders2005改为P_GetPagedOrders2000就可以了。谢谢!

2007-01-22 10:57  salough

samples用的都是sql2005数据库的吧?sqlHelper是个什么类呢?
回复:6.0.0 for VS2005中的示例用的数据库是sql server 2005,当然也可以改为2000,只需要把那个分页存储过程名改一下就行了,P_GetPagedOrders2000是sql server 2000和2005都可以用的,P_GetPagedOrders2005是只有sql server 2005才支持的。SqlHelper是访问SQL Server数据库的能用类。谢谢!

2007-01-22 09:35  huahua8316

你好,你提供的2005原代码无法编译好像无法编译,提示以下错误<br>找不到资源文件“AspNetPager.zh-CHT.resx”。谢谢提示一下
回复:这个文件是繁体中文资源文件,因为没做完而且下载提供的是简体中文版,所以没有包进去,另外我是自己用csc.exe命令来编译控件的,而不是用vs2005,因为用vs2005编译的话就没法正确打包控件的图标了。谢谢!

2007-01-21 15:17  yanger

你好!我用了你的分页控件,实在是太棒啦!但是有的问题我还是没有办法解决。<br>我使用了Urlrewrite组件,里面使用了你的分页控件,http://localhost:8001/null/3/0/0/SearchResult0.aspx。但是我使用了你的控件分页的url分页方式的话会出现http://localhost:8001/null/3/0/0/SearchResult0.aspx?Name=null&amp;Star=3&amp;Price=0&amp;Canton=0&amp;PageIndex=0&amp;page=6。就是说参数出现了2次。请问这个问题是怎么解决才好了。谢谢
回复:哪个参数出现了两次呢?您是否启用了Url重写功能?如果是的话UrlRewritePattern又是如何写的呢?谢谢!

2007-01-20 16:59  kinke

老师您好!我在使用433版本的时候出现了这个问题!每当翻页的时候,整个页面的位置就移动到控件所在的页面中的位置,而不是整个页面的顶端!<br>必要要在页面执行后加上window.location.href=&quot;#top&quot;才回到顶端,请问要如何解决!??谢谢!
回复:您是不是把我的示例中那段用客户端脚本scrollIntoView这个方法滚动页面位置的代码也复制到您的项目中了?否则的话不应该滚动到控件所在的位置,或者您用了其它什么方法使页面位置在回发后被保持住了,AspNetPager分页控件本身没有这个功能。谢谢!

2007-01-20 09:33  rosanshao

非常谢谢你的分页控件,问一下问题,http://www.webdiyer.com/AspNetPager/docs/index.html这个帮助文档是用工具帮助生成的吗?是请问是不是支持VS 2005,是什么工具。谢谢
回复:您好,帮助文档每个页面的最下边都有说明以及链接,您可以看一下,文档是用ndoc生成的。谢谢!
;