属性“CommandArgument”只写
我的代码中有以下行,位于 ImageButton 的单击事件处理程序内:
Protected Sub FinaliseBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles FinaliseBtn.Click, SubmitPaymentViaChequeBtn.Click
Dim str as String = sender.commandargument.ToString.ToLower
End Sub
两个控件都是 ImageButton 的。但是,我收到以下错误:
Property 'CommandArgument' is WriteOnly.
任何人都可以看到为什么我收到此错误,因为通常我可以从事件处理程序内的 CommandArgument 读取。事实上,这肯定是它们的主要用途!
谢谢。
I have the following line in my code, inside the click event handler of an ImageButton:
Protected Sub FinaliseBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles FinaliseBtn.Click, SubmitPaymentViaChequeBtn.Click
Dim str as String = sender.commandargument.ToString.ToLower
End Sub
Both Controls are ImageButton
's. However, I'm getting the following error:
Property 'CommandArgument' is WriteOnly.
Can anyone see why I'm getting this error as usually I can read from a CommandArgument inside an event handler. In fact, surely thats their main use!
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已为 EventArgs 连接了一个事件,但正在尝试检索 CommandArgs。
这应该是你的方法:
You've wired up an event for EventArgs, but trying to retrieve CommandArgs.
This should be your method: