为 ASP 动态数据中的一张表自定义 List.aspx
我刚刚严格按照 MS 说明自定义动态数据页面模板一张桌子。创建文件夹 CustomPages/MyTable/List.aspx
,并将 PageTemplates/List.aspx 复制到该文件夹中,但我现在收到编译器错误,因为我在两个 List.aspx 文件中都有重复的方法。
我做错了什么?
刚刚:我发现了另一个非 MS 页面,现在我再也找不到了,但他提出了几乎显而易见的建议:更改我的自定义列表页面的 j 3 个文件中的类名称。
I have just meticulously followed MS instructions for customising a dynamic data page template for one table. Create the folder CustomPages/MyTable/List.aspx
, and copy PageTemplates/List.aspx into that folder, but I now get compiler error because I have duplicated methods in both List.aspx files.
What am I doing wrong?
Just in: I found another, non-MS page that I can't find again now, but he suggested the almost obvious: to change the class name in thej 3 files of my custom list page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定说明中的内容,但您需要更改两个代码隐藏文件(List.aspx.cs 和 List.aspx.designer.cs)以及“继承”引用中的命名空间.aspx 文件,或者是的,您将拥有重复的方法(相同的命名空间、相同的类名、相同的方法名)。
您应该更改命名空间以反映自定义页面所在的路径 - 这将有助于确保它保持唯一。
I'm not sure what it says in the instructions, but you'll need to change the namespace in the two codebehind files (List.aspx.cs and List.aspx.designer.cs) and in the "inherits" reference in the .aspx file or yes, you will have duplicate methods (same namespace, same class name, same method name).
You should change the namespace to reflect the path that the custom page is in - this will help ensure it stays unique.