datagride视图中的问题 [英] problem in datagride view

查看:91
本文介绍了datagride视图中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是asp.net的新手.
在我的ASP页面中,我有一个GridView控件.在该控件中,我添加了一个列作为按钮.现在我希望当我单击按钮时,事件就会发生.

现在我的问题是我应该在哪里编写代码?

hello I am new in asp.net.
In my asp page i have a GridView control. in that control I have added a column as button. Now I want that when i will click the button, event will occure.

Now my question is where should I write code? means in which event of the gridview control.

推荐答案



在源代码中设置按钮命令属性,例如. "AddNew".

转到gridview的行命令"事件并键入以下内容:

Hi,

Set the button command property in source eg. "AddNew".

Go to Row Command event of gridview and type the following:

if(e.CommandName == "AddNew"){
    //your code goes here..
}


这会为您提供帮助.

祝一切顺利.
-AK


This will help you.

All the best.
-AK


参考: http://msdn.microsoft.com /en-us/library/bb907626.aspx [ ^ ]
http://www.ezzylearning.com/tutorial.aspx?tid=5066444 [ ^ ]
希望对您有所帮助.
Refer :http://msdn.microsoft.com/en-us/library/bb907626.aspx[^]
http://www.ezzylearning.com/tutorial.aspx?tid=5066444[^]
hope this helps.


使用GridView行命令事件
^ ]
Use GridView Row Command event
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowcommand.aspx[^]


这篇关于datagride视图中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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