还在寻找答案 [英] Still looking for an answer
问题描述
嗨
我有一个带有Datagrid的网络表单。在数据网格中,我有一个列
按钮。如果按钮的类型为Linkbutton,则按钮的类型为Linkbutton。我的VB代码隐藏将会捕获
用户
" click"
但是,如果它设置为按钮我无法捕获用户
点击。请参阅下面的代码。
我不明白我错过了什么。为什么不是
"按钮"工作?
VB代码背后:
Private Sub DataGrid1_ItemCommand(ByVal source As Object,ByVal e As
System.Web。 UI.WebControls.DataGridCommandEventArgs)句柄
DataGrid1.ItemCommand
''获取行的值
结束子
>
HTML:
< body MS_POSITIONING =" GridLayout">
< form id =" Form1"方法= QUOT;交" runat =" server">
< asp:DataGrid id =" DataGrid1" style =" Z-INDEX:101;左:80px;位置:
绝对值; TOP:140px RUNAT = QUOT;服务器" Width =" 484px">
< Columns>
< asp:ButtonColumn Text =" Select" ButtonType =" PushButton"
CommandName =" Select">< / asp:ButtonColumn>
< / Columns>
< / asp:DataGrid>
< / form>
< / body>
谢谢
Brian
Brian,
" BrianDH" <峰; br ***** @ discussions.microsoft.com> schrieb:我有一个带有Datagrid的Web表单。在数据网格中,我有一个Column
按钮。如果按钮的类型为Linkbutton,则按钮的类型为Linkbutton。我的VB代码隐藏将
抓住用户
点击
但是,如果它被设置为按钮我无法捕获用户
点击。请参阅下面的代码。
请注意,ASP.NET数据网格有一个单独的组:
< URL :news://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.datagridc ontrol>
-
MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org/>
VB< URL:http://dotnet.mvps.org/dotnet / faqs />
是的,但我不是在做ASP这是一个由VB代码运行的Web表单吗?
事件将由服务器端VB.Net代码而不是ASP,客户端代码来处理。
但我也会在那里尝试。
" Herfried K. Wagner [MVP]"写道:
Brian,
" BrianDH" <峰; br ***** @ discussions.microsoft.com> schrieb:我有一个带有Datagrid的Web表单。在数据网格中,我有一个Column
按钮。如果按钮的类型为Linkbutton,则按钮的类型为Linkbutton。我的VB代码隐藏将
抓住用户
点击
但是,如果它被设置为按钮我无法捕获用户
点击。请参阅下面的代码。
请注意,ASP.NET数据网格有一个单独的组:
< URL:news://news.microsoft .com / microsoft.public.dotnet.framework.aspnet.datagridc ontrol>
- MS Herfried K. Wagner
MVP< URL:http:// dotnet。 mvps.org/>
VB< URL:http://dotnet.mvps.org/dotnet/faqs/>
>
"????= UTF-8乙QnJpYW5ESA == = QUOT; <峰; br ***** @ discussions.microsoft.com>写在
新闻:B4 ********************************** @ microsof t .com:
是的,但我不是在做ASP这是一个由VB代码运行的网页表单?
该事件将由服务器端VB.Net代码进行处理不是ASP,客户端
边码。
它是ASP.NET,而不是VB.NET Winforms。你最好得到你的术语
理顺了; )
-
Lucas Tam(RE********@rogers.com)
请删除[移除"来自回复时的电子邮件地址。
http://成员。 ebay.com/aboutme/coolspot18/
Hi
I have a web form with a Datagrid. Within the data grid I have a Column
button. If the button is of type "Linkbutton" my VB code-behind will catch
the users
"click"
However, if it is set to "Pushbutton" I am unable to trap the users
click. See code Below.
I don''t understand what I am missing. why won''t the
"Pushbutton" work?
VB code Behind:
Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
DataGrid1.ItemCommand
''get value of row here
End Sub
HTML:
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 80px; POSITION:
absolute; TOP: 140px" runat="server" Width="484px">
<Columns>
<asp:ButtonColumn Text="Select" ButtonType="PushButton"
CommandName="Select"></asp:ButtonColumn>
</Columns>
</asp:DataGrid>
</form>
</body>
Thanks
Brian
Brian,
"BrianDH" <Br*****@discussions.microsoft.com> schrieb:I have a web form with a Datagrid. Within the data grid I have a Column
button. If the button is of type "Linkbutton" my VB code-behind will
catch
the users
"click"
However, if it is set to "Pushbutton" I am unable to trap the users
click. See code Below.
Notice that there is a separate group for the ASP.NET datagrid available:
<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.datagridc ontrol>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Yes but I am not doing ASP this is a web form run by VB code-behind? The
event would be traped by server side VB.Net code not ASP, client side code.
ButI''ll try there too.
"Herfried K. Wagner [MVP]" wrote:
Brian,
"BrianDH" <Br*****@discussions.microsoft.com> schrieb:I have a web form with a Datagrid. Within the data grid I have a Column
button. If the button is of type "Linkbutton" my VB code-behind will
catch
the users
"click"
However, if it is set to "Pushbutton" I am unable to trap the users
click. See code Below.
Notice that there is a separate group for the ASP.NET datagrid available:
<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.datagridc ontrol>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
"=?Utf-8?B?QnJpYW5ESA==?=" <Br*****@discussions.microsoft.com> wrote in
news:B4**********************************@microsof t.com:
Yes but I am not doing ASP this is a web form run by VB code-behind?
The event would be traped by server side VB.Net code not ASP, client
side code.
It''s ASP.NET, not VB.NET Winforms. You better get your terminology
straightened out ; )
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
这篇关于还在寻找答案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!