了解网络用户控件 [英] understand web user control

查看:54
本文介绍了了解网络用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我正在尝试学习用户控件,并且还在网络上找到了一些文章.

由于我不太了解网络用户控制.

我不明白此代码的工作方式/流程.根本没有得到代码.

例如,在给定的链接中,有一个自定义GridView的示例,其中有一个方法OnPageIndexChanging.

但是OnPageIndexChanging方法的代码在哪里.

在给定的代码中,将参数传递给此方法以更改页面索引,更改页面页面大小等.

但是我不知道它是如何工作的,代码在哪里.

请查看链接.

具有自定义寻呼机,复选框列,序列号列,自定义导航的自定义Gridveiw控件

Dear All,

I am trying to learn user control ans also found some articles on web.

As I am not so much aware of web user contol.

I am not getting how this code works/flows. Simply not getting code.

For example in given link there is a example of custom GridView in which there is one method OnPageIndexChanging.

But where is code of OnPageIndexChanging method.

In given code parameters are passed to this method for changing page index,for changing page page size etc.

But i am not getting how this works and where is code.

Please see the link.

Custom Gridveiw Control with Custom Pager, Check Box Column, Serial Number Column, Custom Navigation

推荐答案

它是一个自定义网格,因此它是从GridView继承的.它只是引发基类事件OnPageIndexChanging,该事件的声明在GridView中.使用IDE浏览事件的定义(在OnPageIndexChanging上单击鼠标右键->转到定义"),您将看到它的位置.
It''s a custom grid, so it''s inheriting from GridView. It''s simply raising the base class event OnPageIndexChanging, the declaration for that is in GridView. Use the IDE to browse the definition of the event (right mouse over OnPageIndexChanging -> go to defintion) and you will see where it is.


基本上,任何事件默认情况下都是空的.我们需要在事件中定义代码才能执行.
让我们检查一下您的分页.

您是否在页面上定义了OnPageIndexChanging事件.
如果是,则在PageIndexChanging中编写以下代码.
Basically any event is empty by default. we need to define the code in that events to carried it out.
Lets check about your Paging.

Have you define OnPageIndexChanging event on Page.
If yes then write following code in PageIndexChanging.
GridView1.PageIndex = e.NewPageIndex;
//Bind grid Again.



要在GridView中使用分页,您需要注意以下事项
1.指定PageSize.
2.编写PageIndexChanging事件.



To use paging in GridView you need to take care of following things
1. Give PageSize.
2. write PageIndexChanging event.


这篇关于了解网络用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆