首页 \ 问答 \ GridView的自动分页不起作用(GridView's Automatic paging doesn't work)

GridView的自动分页不起作用(GridView's Automatic paging doesn't work)


根据我的书,开始使用自动分页所需的一切就是将GridView.AllowPaging设置为true。 但是当我尝试导航到另一个页面时,我得到GridView触发的事件PageIndexChanging,它没有处理异常 。 然后我必须为PageIndexChanging事件创建事件处理程序,但是当我导航到下一页时,GridView不显示任何内容。

Q1 - 我做错了什么?

Q2 - 本书是为Asp.Net 3.5编写的,但作者提到上述行为中没有一个是? 任何想法为什么我的GridView行为如此不同?


感谢名单

编辑:

我很尴尬地说,但理由不起作用是因为我忘了删除该行

if(IsPostBack) GridView.DataSourceID=""; 


对不起,请花你的时间和感谢帮助我



According to my book all that is needed to start using automatic paging is to set GridView.AllowPaging to true. But when I try to navigate to another page, I get GridView fired event PageIndexChanging which wasn't handled exception. I then have to create event handler for PageIndexChanging event, but then when I navigate to next page, GridView doesn’t display anything.

Q1 - What am I doing wrong?

Q2 - Book is written for Asp.Net 3.5, but none of the behavior described above is mentioned by the author?! Any thoughts why my GridView behaves so differently?


thanx

EDIT:

I'm embarassed to say, but reason it didn't work is because I forgot to remove the line

if(IsPostBack) GridView.DataSourceID=""; 


Sorry for taking your time and thanx for helping me


原文:https://stackoverflow.com/questions/731717
更新时间:2023-02-04 17:02

最满意答案

在基本层面上,没有什么区别,但是他们还在。

Haskell将类型类中定义的函数或值描述为“方法”,正如描述它们所包含的对象中的OOP方法一样。 然而,Haskell处理这些不同,将它们视为个人价值观,而不是将它们固定在一个对象上,因为OOP会导致一个对象。 这是关于最明显的表面水平差异。

Rust最近不能做的一件事就是更高级的打字特质 ,比如臭名昭着的FunctorMonad类型。

这意味着,Rust特性只能描述通常被称为“具体类型”的意思,也就是说,没有一个通用的参数。 然而,Haskell可以使用类似于高阶函数使用其他函数的类型的高阶类型类,使用一个来描述另一个函数。 我们无法在Rust中实现上述类型,因为它不支持在Haskell中被认为是基本的,甚至至关重要的。 幸运的是,最近已经实施了相关的项目 。*然而,这并不是惯用的Rust,而是通常被认为是“黑客”。

正如在评论中所说,GHC(Haskell的主编)支持进一步的类型选项,包括多参数 (即涉及多种类型)类型类型和功能依赖性 ,这也是一个可以选择的类型级别计算,并引导到家庭 。 据我所知,Rust虽然可能在将来也没有funDeps或类型的家庭†

总而言之,虽然特质和类型表现在表面上看起来是相当的,但是当考虑到许多品质时,它们比较更深刻,确实有很大的差异。


*在附注中,斯威夫特尽管有特色,但并没有这样高的打字机制。 未来的语言更新,也许?

†可以在这里找到一篇关于Haskell的类型类(包括更高类型的类型)的文章,而且Rust的特征也是一样的,但是不幸的是,它是一个过时的。


At the basic level, there's not much difference, but they're still there.

Haskell describes functions or values defined in a typeclass as 'methods', just as traits describe OOP methods in the objects they enclose. However, Haskell deals with these differently, treating them as individual values rather than pinning them to an object as OOP would lead one to do. This is about the most obvious surface-level difference there is.

The one thing that Rust could not do, up until recently, was higher-order typed traits, such as the infamous Functor and Monad typeclasses.

This means that Rust traits could only describe what's often called a 'concrete type', in other words, one without a generic argument. Haskell, however, can make higher-order typeclasses which use types similar to how higher-order functions use other functions, using one to describe another. We couldn't implement the typeclasses aforementioned in Rust, because it didn't support this feature that is regarded as basic, and even essential, in Haskell. Thankfully, this has been implemented recently with associated items.* However, this is not idiomatic Rust, and is generally considered a 'hack'.

It is also mentionable, as said in the comments, that GHC (Haskell's principal compiler) supports further options for typeclasses, including multi-parameter (i.e. many types involved) typeclasses, and functional dependencies, a lovely option that allows for type-level computations, and leads on to type families. To my knowledge, Rust has neither funDeps or type families, though it may in the future.†

All in all, whilst traits and typeclasses may seem equivalent on the surface, they do have a lot of differences when compared more deeply, when considering numerous qualities.


* On a side note, Swift, despite having traits, has no such higher-typing mechanism. A future update to the language, maybe?

† A nice article on Haskell's typeclasses (including higher-typed ones) can be found here, and an equally good one on Rust's traits is kept here, though is unfortunately a tad out-of-date.

相关问答

更多
  • 这真的取决于你想达到什么。 如果您对OCaml多态比较函数感到满意(这对于循环函数和函数值不起作用),您可以简单地编写: let my_sort l = List.sort Pervasives.compare l 模仿类型类的更通用的方法是使用函子: module type COMPARABLE = sig type t val compare: t -> t -> int end module MySort (C: COMPARABLE) = struct let sort l = Li ...
  • 你可以直接调用trait方法: fn main() { let mut a = String::new(); let mut b = std::fs::File::create("test").unwrap(); std::fmt::Write::write_fmt(&mut a, format_args!("hello")); std::io::Write::write_fmt(&mut b, format_args!("hello")); } 你也可以选择只在更小的范 ...
  • MonadPlus和Monoid提供不同的用途。 Monoid参数Monoid一种类型* 。 class Monoid m where mempty :: m mappend :: m -> m -> m 所以它可以被实例化为几乎任何类型,有明显的操作符是关联的,并且具有一个单位。 但是, MonadPlus不仅指定您有一个单体结构,而且还指出该结构与Monad工作原理有关, 而且该结构并不关心monad中包含的值,这部分是由事实上, MonadPlus采取了一种类型的争论* -> * 。 ...
  • 假设我有一个应用程序,其核心数据是项目,文档集(“DocSets”)和文档(“文档”)。 文档不限于任何特定的内容类型; 他们可以是电子表格,图像,HTML等,并且可以具有其他文档没有的功能/行为。 这听起来像你不知道类型可以有多个构造函数(和类型)。 而不是你的Doc : data Doc = PagedTextDoc {docTitle :: Text, docContents :: ByteString} | SpreadsheetDoc {docTitle :: Text, doc ...
  • 部分原因是,单碟和箭头是Haskell的新颖创新功能,而收藏相对更平凡。 哈斯克尔作为研究语言有悠久的历史; 有趣的研究问题(设计monad实例和定义单子通用操作)比“工业强度”抛光(定义容器API)获得更多的开发工作。 部分原因是这些类型来自三个不同的包(基础,容器和矢量),有三个独立的历史和设计师。 这使得他们的设计师难以协调提供任何单一类型类的实例。 部分原因是,定义一个类型类来覆盖您提到的所有五个容器是非常困难的。 列表,序列和向量是相对相似的,但是Map和Set具有完全不同的约束。 对于List, ...
  • 在基本层面上,没有什么区别,但是他们还在。 Haskell将类型类中定义的函数或值描述为“方法”,正如描述它们所包含的对象中的OOP方法一样。 然而,Haskell处理这些不同,将它们视为个人价值观,而不是将它们固定在一个对象上,因为OOP会导致一个对象。 这是关于最明显的表面水平差异。 Rust最近不能做的一件事就是更高级的打字特质 ,比如臭名昭着的Functor和Monad类型。 这意味着,Rust特性只能描述通常被称为“具体类型”的意思,也就是说,没有一个通用的参数。 然而,Haskell可以使用类似 ...
  • Rust中的特征继承与OOP继承不同。 特质继承只是一种指定需求的方法。 trait B: A 并不意味着如果一个类型实现B ,它将自动实现A ; 这意味着如果一个类型实现B它必须实现 A 这也意味着如果实施B ,你将不得不单独实施A 举个例子, trait A {} trait B: A {} struct S; impl B for S {} // Commenting this line will result in a "trait bound unsatisfied" error impl ...
  • 选项类型定义如下: enum Option { None, Some(T), } 这意味着Option类型可以有None或者Some值。 The Option type is defined as: enum Option { None, Some(T), } Which means that the Option type can have either a None or a Some value.
  • '或'符号 不,这样的事情对我来说没有意义 - 如果某事可能是A或B ,代码会做什么? 括号 不,除非你计算Fn(...)和朋友中的括号,使用尖括号作为泛型( Vec )或在切片中使用方括号( [u8] ),但这些是类型的一部分。 同样,这样的请求对我没有意义,为什么你需要任何类型的分组? 否定 不,我相信这是因为处理负面逻辑会使事情变得复杂得多。 其他运营商 有? (问号)约束 。 来源:我编写了一个Rust代码解析器 。 虽然我可能错过了一些东西,它解析了我扔过的所有~37500 Rust文件,所 ...
  • 看看作为Hackage的Haddock显示的一部分制作的索引 Take a look at the indices produced as part of Hackage's Haddock display

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)