RowCommand没有使用tabcontainer进入asp.net的gridview [英] RowCommand is not getting in gridview in asp.net using tabcontainer

查看:88
本文介绍了RowCommand没有使用tabcontainer进入asp.net的gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我使用的是Asp.net,VS2008。



我有gridview in tabcontainer和使用带有linkbutton的项目模板字段(选择)。



在linkbutton中,我已经指定了CommandName和CommandArgument。之后我使用



GridView1_RowCommandand和GridView1_RowEditing事件并在GridView1_RowCommand中放置断点。



但是在运行时如果我选择任何行而不是RowCommand事件没有进入gridview。



如何在GridView1_RowCommand和gridview中分配断点.......... ..



问候

Mukesh

Hi,

I am using Asp.net , VS2008.

I have gridview in tabcontainer and using item template field with linkbutton (select).

In linkbutton i have assinged CommandName and CommandArgument. after that i am using

GridView1_RowCommandand and GridView1_RowEditing Event and put break point in GridView1_RowCommandand.

but in runtime if i select any row than RowCommand event is not getting in gridview.

how to assign break point in GridView1_RowCommandand in gridview............

Regards
Mukesh

推荐答案

虽然你的问题不是清楚我试图回答我的理解...



.aspx.cs文件中的链接按钮代码应该像......



Though Your question is not clear i am trying to answer from what i understood...

your link button code in .aspx.cs file should be like...

<asp:linkbutton id="lnkdelete" runat="server" text="Delete" commandname="del" commandargument='<%# Eval("PrimaryKey_ID") %>' >
</asp:linkbutton>





这里查看 commandname =del

如果你使用命令名删除或编辑它会自动调用 OnRowDeleted或OnRowEdited 事件

因此请确保您没有使用此保留关键字作为您的命令名,否则它将调用这些事件并且您的OnRowCommand事件将无法执行。



另一件事尝试使用OnRowCommand 1 (){}如果这样做。

请详细说明你的问题。



希望这个帮助



here look at commandname = "del",
if you use commandname "delete" or "edit" it will automatically call the OnRowDeleted or OnRowEdited event
so make sure you are not using this reserved keyword as your commandname otherwise it will call those events and your OnRowCommand Event will not get executed.

AND another thing try to use OnRowCommand1(){} if this works.
please elaborate your question.

Hope This Help


同样的问题mukesh ..

你有没有解决方案...... ??
same problem mukesh..
Have u got any solution for that...??


这篇关于RowCommand没有使用tabcontainer进入asp.net的gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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